使用簡單的HTML DOM庫時,我遇到了一些網站的問題。當我試圖加載以下網址http://www.t-mobile.com/shop/phones/cell-phone-detail.aspx?cell-phone=HTC-One-S-Gradient-Blue&tab=reviews#BVRRWidgetID簡單的HTML DOM問題
我的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.
什麼問題?簡單的HTML DOM是否有限制?有沒有其他辦法可以解決這個問題?
你的第一個問題是刮網站。但是,讓我們忘記,我需要設置一個適當的useragent –