phantomjs

Selenium Webdriver: HTML renders differently for Firefox vs. PhantomJS

我的未来我决定 提交于 2019-12-20 03:52:34
问题 I am using Selenium Webdriver in Node JS to do a Google search. When I set the browser as Firefox on my local machine, the Google results page renders as expected; it's the same as I see when I do the Google search as a human. Now, I'm trying to do the same on my Heroku server. I can't seem to get Firefox on the server, so I'm using PhantomJS. It successfully does the Google search, but some data is missing from the page (I presume it is added later by Javascript). How can I make the

PHP + PhantomJS Rasterize

扶醉桌前 提交于 2019-12-20 03:34:22
问题 I'm using PhantomJS 64 bit in my PHP application to dynamically capture an HTML page to be emailed to the user. phantomjs rasterize.js "http://..." /path_to_images/image.png This method works fine when I run the above on the command line but when the PHP script runs the command using exec it fails with no output and returns exit code 11. If I switch it to use the 32 bit phantomJS binary, the command succeeds but fails to load the google JSAPI on the page since with error Reference Error: can

(window.beforeEach || window.setup) is not a function

£可爱£侵袭症+ 提交于 2019-12-20 02:59:29
问题 I've tried to setup a testing environment with mocha, phantomjs and istanbul (and grunt). It works great so far, but when it comes to angular-testing i got some problems. I want (and need) to use angular-mocks, but as soon as I include it in my test.html, I get the following console-error in my browser: Uncaught TypeError: (window.beforeEach || window.setup) is not a function The matching code in amgular-mocks.js is the following one: (window.beforeEach || window.setup)(function() {

phantomjs - Cookie is not being sent for any XHR/POST/GET AJAX requests

删除回忆录丶 提交于 2019-12-19 12:28:07
问题 I found an interesting issue when attempting to login using PhantomJS. I'm at a loss as to why it's actually occurring. Basically you start up a remote debugger like so: /usr/local/bin/phantomjs --web-security=no --remote-debugger-port=13379 --remote-debugger-autorun=yes /tmp/test.js Within the remote debugger: > location.href = "https://www.mysite.com/login" > $('input[name="username_or_email"]').val('blah@email.com') > $('input[name="password"]').val('wrongpassword') > $('button[type=

Add proxy to PhantomJSDriver (Selenium C#)

纵饮孤独 提交于 2019-12-19 11:39:49
问题 I'd like to listen to traffic generated by phantomjs selenium driver in c#. The below code does not work unfortunately! PhantomJSOptions phoptions = new PhantomJSOptions(); phoptions.AddAdditionalCapability("proxy", "http://localhost:9999"); driver = new PhantomJSDriver(phoptions); can anyone help me what's wrong with it! Thanks in advance 回答1: Proxy proxy = new Proxy(); proxy.HttpProxy = string.Format("127.0.0.1:9999"); var service = PhantomJSDriverService.CreateDefaultService(); service

Using CasperJS as a Portable Installation?

陌路散爱 提交于 2019-12-19 10:57:07
问题 I'm trying to run CasperJS in a portable way that doesn't involve setting the path variable in Windows. Currently I have gotten this to partially work by moving the phantomjs executable along with the entire contents of the CasperJS directory to the batchbin folder. I also edited the batch file to make it initialize casperJS using the current directory, which is where all the files are located. Here is my directory with all the files: http://i.imgur.com/ByTjU0s.png My casperjs.bat file: @ECHO

Opening password protected site (Passport.js) with Phantom.Js by setting cookie

こ雲淡風輕ζ 提交于 2019-12-19 10:53:22
问题 I am trying to access a passport protected page of my Express.js app with a Phantom.js script. How can I simulate a logged in user without knowing the passport? I am using Passport.js as a auth library with LocalStrategy and MongoStore to safe the sessions in the mongo database. I am wondering if I can create a record in the sessions collection and set a generated cookie with Phantom.js ( phantom.addCookie(...) ) to simulate a specific logged in user without the password of the user? Can I

How to hide FirefoxDriver (using Selenium) without findElement function error in PhantomDriver(headless browser)?

∥☆過路亽.° 提交于 2019-12-19 10:44:34
问题 I try to make hidden FirefoxDriver. According to my research I must use PhantomJSDriver but when I use PhantomJSDriver driver.FindElement statement no longer does not work. var options = new PhantomJSOptions(); options.AddAdditionalCapability("phantomjs.page.settings.userAgent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36"); PhantomJSOptions p = new PhantomJSOptions(); var service = PhantomJSDriverService.CreateDefaultService();

Module version mismatch with headless browser and desktop Node

只谈情不闲聊 提交于 2019-12-19 10:09:20
问题 I'm getting a "Module version mismatch error" when I try to use a headless browser with a desktop Node shell. I've tried Zombiejs and Phantomjs with both nw.js and atom-shell; in both cases as soon as the headless browser comes into play the application crashes with a module mismatch error. Here's the error with Phantomjs and atom-shell: Uncaught Exception: Error: Module version mismatch. Expected 41, got 14. at Error (native) at Object.module.(anonymous function) (ATOM_SHELL_ASAR.js:118:20)

LoadError: cannot load such file — selenium/webdriver/phantomjs

狂风中的少年 提交于 2019-12-19 08:59:41
问题 I have this code in my Cucumber Hooks file to run the ghost driver it was working until yesterday I start seeing the error message: Before do Selenium::WebDriver::PhantomJS.path = 'C:\phantomjs-2.1.1-windows\bin\phantomjs.exe' @browser = Watir::Browser.start "https://www.google.com", :phantomjs @browser.window.maximize end Error message: LoadError: cannot load such file -- selenium/webdriver/phantomjs 回答1: Yes, we've removed support for PhantomJS as of Selenium 3.8. The PhantomJS project is