问题描述:

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); 
相关阅读:
Top