phantomjs

Is PhantomJS CPU (core) bound?

£可爱£侵袭症+ 提交于 2019-12-07 08:17:00
问题 I'm starting to do some parallel browser based testing and want to see how many browsers I can run in parallel on an EC2 large box before hitting 100% CPU. I'm using the JMeter webdriver plugin to actually run the browsers. With FireFox it's literally 1 browser per CPU core. 4 browsers on a 4 core box is about 80% CPU. With 5 browsers it's 95% (which isn't good for performance testing). Before I go down the path of PhatomJS, are there any benchmarks that compare PhantomJS to FireFox (or even

node-phantom createPage() never calls callback

与世无争的帅哥 提交于 2019-12-07 07:28:56
问题 I used nodejs with node-phantom module for some time. It worked fine. Now I try it on another machine and same code example don't work: var Scan=function(request,response) { var parsedURL=url.parse(request.url,true); if(parsedURL.query.site) { console.log("scanning "+parsedURL.query.site); phantom.create(function(err,ph) { console.log(err); return ph.createPage(function(err,page) { console.log(err); return page.open(parsedURL.query.site, function(err,status) { console.log("opened site? ",

new Date(“YYYY-MM-DD”) stopped working in Qt WebKit after removing MacPorts

独自空忆成欢 提交于 2019-12-07 06:36:34
问题 On my OS X 10.7.3 (Lion) laptop, I cannot parse JavaScript date strings with Qt WebKit using the Date constructor. Using either jasmine-headless-webkit or phantomJS, all calls like: new Date("2012-04-10") always return "Invalid Date" instead of a valid Date object. A few weeks back, everything was working fine, and I've checked this on half a dozen computers with a similar setup and cannot reproduce the problem anywhere else. I am fairly certain the problems started when I decided to clear

Executing Javascript on Selenium/PhantomJS

我的未来我决定 提交于 2019-12-07 06:04:21
问题 I'm using PhantomJS via Selenium Webdriver in Python and I'm trying to execute a piece of JavaScript on the page in hopes of returning a piece of data: from selenium import webdriver driver = webdriver.PhantomJS("phantomjs.cmd") # or add to your PATH driver.set_window_size(1024, 768) # optional driver.get('http://google.com') # EXAMPLE, not actual URL driver.save_screenshot('screen.png') # save a screenshot to disk jsres = driver.execute('$("#list").DataTable().data()') print(jsres) However

exporting highcharts polar chart to PDF with phantomjs

偶尔善良 提交于 2019-12-07 04:53:13
问题 I'm evaluating highcharts for a client project and have run into a problem rendering a polar chart with phantomjs. The charts lines come out as a thick grey blob! I thought this was due to animation but thats turned off. Will try and post an image but anyone have any thoughts on what else could be causing this? If I print preview from chrome it also looks ok. Here's the image. This was created as part of a report which I built using the rasterize.js script included with phantomjs. All the

CasperJS click() doesn't load new html

和自甴很熟 提交于 2019-12-07 04:15:02
问题 I'm trying to use CasperJS' click() to follow a link which generates a modal on the current screen. When I query the proper selector and click it in the browser console using document.querySelector().click() it works, but even when I casper.evaluate() this it doesn't work. I found someone who had a very similar problem, but his question remains unanswered, and I am experiencing almost identical problems. casperjs button click doesn't navigate to next page the code I'm currently using is this

Switch frames with selenium and phantomJS

那年仲夏 提交于 2019-12-07 03:51:28
I need to open the search windows on this page. https://permits.losgatosca.gov/CitizenAccess/default.aspx With firefox is working just fine, but when I try to do the same with phantomJS i got an error. This is the code I'm using to open the search BUTTON_id = 'ctl00_PlaceHolderMain_TabDataList_TabsDataList_ctl01_LinksDataList_ctl00_LinkItemUrl' #'//*[@id="ctl00_PlaceHolderMain_TabDataList_TabsDataList_ctl01_LinksDataList_ctl00_LinkItemUrl"]/span' driver_1.switch_to_frame("ACAFrame") button = driver_1.find_element_by_id(BUTTON_id) button.click() And this is the error I'm getting with phanthomJS

Web scraping with CasperJS returns strange error that isn't documented

蹲街弑〆低调 提交于 2019-12-07 02:13:38
问题 I wrote an web scraping script with CasperJS and it works perfectly on Mac OS 10.10.4 with CasperJS version 1.1.0-beta3 and PhantomJS version 1.9.8, but when I put the same script on one of my servers which is Ubuntu 14.04 (running inside Docker container) with the same environment (CasperJS and PhantomJS all the same versions) it suddenly just outputs this: I'm `fs` modules Which is pretty strange. One of my suggestion is that in this script I am also trying to require some other scripts

Where are screenshots from phantom.js saved?

别来无恙 提交于 2019-12-07 01:27:41
问题 Just starting out with Phantom.js after installing via Homebrew on my mac. I'm trying out the examples to save screenshots of websites via https://github.com/ariya/phantomjs/wiki/Quick-Start var page = require('webpage').create(); page.open('http://google.com', function () { page.render('google.png'); phantom.exit(); }); But I don't see the images anywhere. Will they be in the same directory as the .js file? 回答1: PhantomJS usually renders the images to the same directory as the script that

Is there a way to disable Google Analytics tracking in PhantomJS?

≯℡__Kan透↙ 提交于 2019-12-07 01:15:33
问题 I want to track some sites using PhantomJS, but I don’t want to spam peoples Google Analytics. Is there a way to disable the Google Analytics tracking script (ga.js / analytics.js) from sending data to Google? Like it is possible with the usual GAOptOut browser plugins. I had a look in the Chrome Plugin and tried the code from that, but it doesn’t seem to be executed when telling PhantomJS to do so (onLoadStart). 回答1: Use page.onResourceRequested method to abort all requests to google