特定のIDを持つaのsrcを取得しようとしています。 例:特定のIDを持つsrcのWebスクレイピングを取得する
<img id="hi_1" src="url of image 1">
<img id="hi_2" src="url of image 2">
<img id="hi_3" src="url of image 3">
result = url of image 1;
私はこのコードを持って:あなたは<img id="hi_1" src="(.*)">
ような何かを探している
$html = file_get_contents('url of site');
preg_match('here I don't know what to do', $html, $src);
$src_out = $src[1];
可能な重複http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html- xml-in-php) –