phantomjs

CasperJS click() doesn't load new html

拥有回忆 提交于 2019-12-05 11:25:26
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.waitForSelector('div.talk-sharing__tools a.rate-button', function() { this.then(function() { this

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

寵の児 提交于 2019-12-05 11:10:16
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 out my old supposedly-unused MacPorts installation (I have long since switched to Homebrew and was doing

exporting highcharts polar chart to PDF with phantomjs

喜夏-厌秋 提交于 2019-12-05 10:01:40
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 other charts work fine, the polar chart is the only one not coming out. If I use the highcharts export

Adding a hash prefix at the config phase if it's missing

若如初见. 提交于 2019-12-05 09:58:45
I am now integrating phantom in my Angularjs-based web application. This fine article says that I should call the $locationProvider.hashPrefix() method to set the prefix to '!' from SEO reasons(allow crawlers to intercept the _escaped_fragment component of the URL). The problem is that I haven't though of the earlier, and some of my URLs look as following: #/home . I though perhaps there is a way that I can implant this '!' char into the begging of the URL programmatically(in case it is not already there) at the config function of the APP, instead having to edit a lot of markup manually. I've

How to correctly pass basic auth (every click) using Selenium and phantomjs webdriver

你离开我真会死。 提交于 2019-12-05 09:21:54
I am running some unittests with Selenium Webdriver. I have an entire test that runs successfully using webdriver.Firefox(), here is the setup: def setUp(self): self.driver = webdriver.Firefox() self.driver.implicitly_wait(30) self.base_url = "http://www.nike.com" self.verificationErrors = [] self.accept_next_alert = True The test runs successfully, however I have to manually enter in basic auth multiple times for the test to keep moving forward. In an attempt to bypass basic auth and have the entire test truly automated, I have switched from Firefox to phantomjs, as it sounds like you can

PhantomJS unexpected load behavior with multiple pages

北慕城南 提交于 2019-12-05 08:58:45
i have a script (below) that scrapes a site with a 3 step process. it works great when set to a maximum of 1 page at a time. however, when i increase that to 2 at a time things start getting wonky. the onFinished fires earlier than i would expect and the page isn't completely loaded yet. because of this the rest of my script breaks. any idea why this might be happening? i should add that i'm using the newest version (1.5). MAX_PAGES = 1 ### changing MAX_PAGES to >1 causes some pages onFinished event to fire before the page is fully rendered. this is evident by the fact that there are >1 images

PhantomJS page dump script issue

不打扰是莪最后的温柔 提交于 2019-12-05 08:09:01
Digikey has changed their website and now has a javascript that is called onload via post. This killed my former simple java HTML code retriever. I am trying to use PhantomJS to allow the execution of the javascript before saving the HTML/text. var page = new WebPage(), t, address; var fs = require('fs'); if (phantom.args.length === 0) { console.log('Usage: save.js <some URL>'); phantom.exit(); } else { address = encodeURI(phantom.args[0]); page.open(address, function (status) { if (status !== 'success') { console.log('FAIL to load the address'); } else { f = null; var markup = page.content;

How to pass PhantomJS path to Selenium Grid

送分小仙女□ 提交于 2019-12-05 08:02:39
I'm getting an error when trying to set up a phantomjs node on Selenium Grid ( https://wiki.jenkins-ci.org/display/JENKINS/Selenium+Plugin ) I've set up the following custom json configuration: { "capabilities": [ { "browserName": "phantomjs", "phantomjs.binary.path": "/usr/bin/phantomjs", "platform": "LINUX", "maxInstances": 5 } ], "configuration": { "nodeTimeout":120, "port":5555, "hubPort":4444, "hubHost":"localhost", "nodePolling":2000, "registerCycle":10000, "register":true, "cleanUpCycle":2000, "timeout":30000, "maxSession":1 } } But I get an error when I run webdriver against it:

Firefox -> PhantomJs Login to website not working

巧了我就是萌 提交于 2019-12-05 08:00:43
问题 For some reason when I don't run headless I am able to log into http://www.neighborhoodscout.com. However when I run headless PhantomJS I am unable to login and it can't find an element it returns on success of a login. Phantom JS version 1.9.8 driver = webdriver.PhantomJS() driver.set_window_size(1124, 850) driver.get(url) time.sleep(2) driver.find_element_by_id("login").click() time.sleep(2) driver.find_element_by_id("user_email").send_keys(username) driver.find_element_by_id("user_password

Issues getting CasperJS to upload image to file field - tried CasperJS fill() and PhantomJS uploadFile()

北慕城南 提交于 2019-12-05 07:56:43
I'm trying to use CasperJS to upload images to a web-form. My form looks something like this: <form action="" method="POST" enctype="multipart/form-data" class="form-vertical"> ... <legend>Campaign Banner</legend> <div class="control-group image-field "> <label class="control-label">Now Large</label> <div class="controls"> <div class="file-field"><input id="id_now_large_image" name="now_large_image" type="file"></div> <div class="image-preview"></div> <div class="clear"></div> <span class="help-inline"></span> </div> </div> <div class="control-group image-field "> <label class="control-label"