PhantomJS create page from string

后端 未结 5 1405
忘掉有多难
忘掉有多难 2020-12-08 04:21

Is it possible to create a page from a string?

example:

html = \'blah blah blah\'

page.open(html,         


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-08 05:16

    Just wanted to mention I recently had a similar need and discovered that I could pass file:// style references as an URL param, so I dumped my HTML string into a local file then passed the full path to my capture script (django_screamshot) which basically uses casperjs and phantomjs + a capture.js script.

    Anyway it just works and its reasonably fast..

提交回复
热议问题