【发布时间】:2016-10-21 14:52:30
【问题描述】:
在使用 Simple HTML DOM 库时,我遇到了一些网站的问题。当我尝试加载以下网址时http://www.t-mobile.com/shop/phones/cell-phone-detail.aspx?cell-phone=HTC-One-S-Gradient-Blue&tab=reviews#BVRRWidgetID
我的 PHP 代码是:
<?php
include "simple_html_dom.php";
$html=new simple_html_dom();
$url="http://www.t-mobile.com/shop/phones/cell-phone-detail.aspx?cell-phone=HTC-One-S- Gradient-Blue&tab=reviews#BVRRWidgetID";
$html->load_file($url);
echo $html;
?>
php脚本没有报错,但每次都显示如下内容。
Unsupported Browser
It appears that you are viewing this page with an unsupported Web browser. This Web site works best with one of these supported browsers:
Microsoft Internet Explorer 5.5 or higher
Netscape Navigator 7.0 or higher
Mozilla Firefox 1.0 or higher
If you continue to view our site with your current browser, certain pages may not display correctly and certain features may not work properly for you.
有什么问题? Simple HTML DOM 有限制吗?有没有其他方法可以解决这个问题?
【问题讨论】:
-
您的第一个问题是抓取网站。但是让我们忘记这一点,我认为您需要设置一个适当的用户代理
标签: simple-html-dom