PhantomJS没有摆脱javascript

时间:2018-11-20 17:29:10

标签: phantomjs

我正在尝试下载包含一些javascript的完整网站数据,然后再将其下载到最终的视频目标,但是从输出屏幕截图看来,它正卡在javascript首次加载的位置。有没有必要让我超越javascript的东西的选项?我给它30秒的加载时间,但仍然没有这样做。谢谢

var page = new WebPage()
var fs = require('fs');

page.open("https://mywebsite.com");
page.onLoadFinished = function(status) {
      setTimeout(30000);
      console.log("page load finished");
      page.render('export.png');
      fs.write('1.html', page.content, 'w');
      phantom.exit();
};

这是错误;

 TypeError: undefined is not a constructor (evaluating 'Number.isNaN(s)')

  https://api.peer5.com/peer5.js?id=fhjr6dqjftxrqng57p8r:8
  :0 in forEach
  https://api.peer5.com/peer5.js?id=fhjr6dqjftxrqng57p8r:8 in processFlags
  https://api.peer5.com/peer5.js?id=fhjr6dqjftxrqng57p8r:8 in exports
  https://api.peer5.com/peer5.js?id=fhjr6dqjftxrqng57p8r:8 in exports
  https://api.peer5.com/peer5.js?id=fhjr6dqjftxrqng57p8r:8 in E
  https://api.peer5.com/peer5.js?id=fhjr6dqjftxrqng57p8r:8 in exports
  https://api.peer5.com/peer5.js?id=fhjr6dqjftxrqng57p8r:8 in W1ff
  https://api.peer5.com/peer5.js?id=fhjr6dqjftxrqng57p8r:8 in n
  https://api.peer5.com/peer5.js?id=fhjr6dqjftxrqng57p8r:8
  https://api.peer5.com/peer5.js?id=fhjr6dqjftxrqng57p8r:8
ReferenceError: Can't find variable: Promise

  https://mywebsite.com/watch-tv/js/external/fetch.js:387 in fetch
  https://mywebsite.com/watch-tv/js/translate.js:51 in fetchTranslation
  https://mywebsite.com/watch-tv/js/translate.js:156 in CSVTranslate
page load finished

0 个答案:

没有答案