2017-04-23 68 views
1

我試圖運行phantomjs來抓取破損的JavaScript網站,因此我通過CLI運行phantomjs時出現錯誤。在破損的網站上運行phantomjs

ReferenceError: Can't find variable: facebook 

網站本身顯示出這樣的錯誤通過控制檯:

Uncaught ReferenceError: facebook is not defined 

它似乎停止phantomjs的任何進一步執行。有什麼辦法可以忽略錯誤並繼續執行phantomjs?

+0

這有幫助嗎? http://stackoverflow.com/a/19538646/1781026&https://github.com/ariya/phantomjs/issues/10042#issuecomment-95668850 – chrki

+0

似乎還凍結,除了phantomjs項目似乎也死了。懷疑我會繼續這一點。 https://www.infoq.com/news/2017/04/Phantomjs-future-uncertain –

回答

0

Phantomjs項目似乎死在水中,因爲鉻能夠無頭瀏覽,因此將被解散。錯誤處理將無法解決我的問題,所以我切換到http://www.nightmarejs.org/

看起來像一個驚人的選擇,它甚至可以告訴你使用現場示例和您提供的命令發生了什麼。