IM試圖讓體育從這個網站phantomjs總是返回一個特定的網站
但是從這個網站,我嘗試我最終找不到網頁
任何地址匹配resul上找不到網頁而在我自己的瀏覽器
這裏打開是一個示例代碼
var webPage = require('webpage');
var page = webPage.create();
page.onConsoleMessage = function(msg) {
console.log(msg);
}
page.open('http://oddsportal.com', function(status) {
page.evaluate(function() {
console.log(document.getElementsByTagName('body')[0].innerHTML);
});
phantom.exit();
});
我不知道他們是如何阻止幻像js,我不知道從哪裏開始.....
有沒有什麼幻影js頭會提醒他們?
我會感激我如何能解決這個
這裏的任何建議或忠告是,網站輸出
<a href="http://www.oddsportal.com">
<img src="logo.jpg" />
</p>
<div id="main" class="home">
<div id="breadcrumb">
<strong>The page you requested is not available.</strong>
</div>
<hr class="hidden">
<div id="col-content">
<h1>Page not found</h1>
<p>This page not exist on OddsPortal.com!</p>
</div>
<div class="break"></div>
<hr class="hidden">
</div>
<div id="footer">
<p class="l">Copyright © 2008-12 OddsPortal.com (v)</p>
<div class="break"></div>
</div>
運行後您看到了什麼輸出或錯誤這個腳本? –
這不是一個phantomjs問題,它是一個重定向問題,如301所示:'$ curl --head http://oddsportal.com HTTP/1.1 301 http:// www.oddsportal.com /'如果可以的話使幻像跟隨重定向,它會加載所需的內容。 – meatspace
@StevenSchobert基本上404頁面沒有找到errro(我已經添加了輸出到我的問題),沒有錯誤我連接到該網站就好了,它只是發送給我的網頁找不到每個地址 – max