当前位置: 动力学知识库 > 问答 > 编程问答 >

phantomjs - I am using phantomjsdriver with selenium. I wanted to generate pdf of the rendered page

问题描述:

I am using phantomjsdriver with selenium. I wanted to generate pdf of the rendered page.

With phantomJS and java script (https://github.com/ariya/phantomjs/blob/master/examples/rasterize.js) I am able to do this.

But I am unable to perform same using phantomjsdriver.

Please help.

网友答案:
PhantomJSDriver phantom = (PhantomJSDriver) driver;
// This line will server the purpose and will execute the required java script.
phantom.executePhantomJS(yourJavaScript,Object args); 
分享给朋友:
您可能感兴趣的文章:
随机阅读: