Using PhantomJS to embed all images of a webpage produces warnings but works

后端 未结 1 499
暖寄归人
暖寄归人 2020-11-30 10:03

I\'m trying to convert a webpage into a single file by embedding all the images (and other external resources once I passed this point). Here\'s how I run PhantomJs:

相关标签:
1条回答
  • 2020-11-30 10:44

    Those notices are printed when phantom.exit is called. They don't cause any trouble, but are not nice when you need a clean PhantomJS output. In your case you can suppress the notices by "asynchronizing" phantom.exit like this:

    setTimeout(function(){
        phantom.exit();
    }, 0);
    

    I think the reason this is happening is because a large string is passed from the page context when phantom tries to exit.

    I created a github issue for this.

    0 讨论(0)
提交回复
热议问题