几个星期以来,我一直在各种页面上运行我的简单 dom 脚本,但从未遇到任何问题。现在,今天,当我尝试:
$html = file_get_html('http://www.sony.co.za/product/dsc-wx10');
我得到:
( ! ) Warning: file_get_contents(http://www.sony.co.za/product/dsc-wx10)
[function.file-get-contents]: failed to open stream: HTTP request failed!
in C:\XXXXXXX\simplephpdom\simple_html_dom.php on line 70
当以下工作时,可能导致我无法成功输入上面的代码:
$html = file_get_html('http://www.google.com');
$html = file_get_html('http://www.whatever.com');
我可以通过我的浏览器访问索尼页面。据我了解,上面的代码连接到端口 80,就像我一样。所以我很难相信我被封锁了。而且,我从第一天就被阻止了。
有什么想法可能导致这种情况吗?