我有这个代码,我在链接行中收到错误。
$link = file_get_contents("http://www.manta.com/search?search=store&pg=1");
$file = strip_tags($link, "<span>");
if(preg_match_all('/<span itemprop="streetAddress">(?:[^<]*)<\/span>/is', $file, $content, PREG_PATTERN_ORDER)){
/*$final = print_r($content, true);
echo $final;
*/
$i = 0;
if(!empty($content[0][$i])){
while(!empty($content[0][$i])){
echo $content[0][$i];
$i++;
}
}
}
错误是
Warning: file_get_contents(http://www.manta.com/search?search=store&pg=1): failed to open stream: HTTP request failed! HTTP/1.1 416 Requested Range Not Satisfiable on line 17.
我只想从该网站获取商店地址。