phantomjs

Using Rselenium on mac sierra

ぐ巨炮叔叔 提交于 2019-12-12 10:19:48
问题 It seems that every time I update my OS, R, or any browsers Rselenium stops working. I can no longer use it with any browser -Firefox, Chrome, or PhantomJS. I've posted my code below. Session Info: sessionInfo() R version 3.3.2 (2016-10-31) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: macOS Sierra 10.12.2 locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached

How to reduce time in getting URL pages from web using GhostDriver and PhantomJS

雨燕双飞 提交于 2019-12-12 10:15:46
问题 I am doing project in Maven. I try to get pages from URl. Till now I am successful in getting pages from web. But I have two questions, Qustions , Below code takes around 14 seconds to get any two URL pages, how can I reduce this time, Help me in optimizing this. After completing the execution, it does not exits from code. Why ? I ended the code with driver.close() . Then, why, it does not exits successfully. I added snapshots before starting and after completing the process. Please see these

Setting proxy in RSelenium with PhantomJS

北战南征 提交于 2019-12-12 09:48:20
问题 I'm using the RSelenium library with the argument browserName = "phantomjs" in the remoteDriver command, however I was looking to run a test where I specify the type of the proxy server. I've seen that proxy authentication is possible in, e.g. Java, with the code used shown here: ArrayList<String> cliArgsCap = new ArrayList<String>(); cliArgsCap.add("--proxy=address:port"); cliArgsCap.add("--proxy-auth=username:password"); cliArgsCap.add("--proxy-type=http"); DesiredCapabilities capabilities

How to fix NoClassDefFoundError: CircularOutputStream error?

試著忘記壹切 提交于 2019-12-12 09:43:09
问题 I was just creating a simple maven project for Selenium WebDriver(a.k.a. Selenium 2) automated test for headless testing. I added the PhantomJS driver dependency as follows with other dependencies in pom.xml: <dependency> <groupId>com.github.detro</groupId> <artifactId>phantomjsdriver</artifactId> <version>1.2.0</version> </dependency> But it is getting error: java.lang.NoClassDefFoundError: org/openqa/selenium/io/CircularOutputStream at org.openqa.selenium.firefox.FirefoxBinary.<init>

Can not deliver image files through phantomjs webserver

99封情书 提交于 2019-12-12 08:48:16
问题 i am trying tp get phantomjs webserver works for me I want to serve 2 files, html file , and a png image file, the html file is served well and rendered correctly in the browser, but the png file is not here is the code for the server var fs = require('fs'); function loadFile(name){ if(fs.exists(name)){ console.log(name+ " File exist"); return fs.open(name,"r"); }else { console.log("File do not exist"); } } var server, service; server = require('webserver').create(); service = server.listen

Use jQuery DOM selector syntax in PhantomJS?

我是研究僧i 提交于 2019-12-12 07:57:48
问题 I'm learning PhantomJS and wondered if it's possible to use jQuery DOM selectors in the JS files PhantomJS runs? I've seen a short example on github that appears to indicate this: Sample of PhantomJS with Qunit (and jQuery?) If you look at the run-qunit.js file at the top it seems state you can use jQuery DOM selectors as parameters. But I'm getting errors when I do that-- not sure whether it's my syntax or because Phantom doesn't know about jQuery, so I thought I'd ask first about the

How to set window size using phantomjs and selenium webdriver in python

ぐ巨炮叔叔 提交于 2019-12-12 07:32:07
问题 I'm trying to get a full sized browser screenshot with phantomjs driven by python webdriver . right now my screenshot is measured at 927 x 870, I'd like to reset it. I have tried: driver.manage().window().setSize(new Dimension(1400,1000)) based on this source, but this is giving syntax errors. How can I do this? 回答1: Because that's Java. Python's documentation is here. There's a method called set_window_size , which is defined here: driver.set_window_size(1400,1000) Further reading: How to

casperjs doesn't work as expected on windows machine

ぃ、小莉子 提交于 2019-12-12 07:26:23
问题 I have a casperjs script which gives the desired result when I run on a linux server, but when I run the same from my laptop, it doesn't work. How should I debug? Logs of the working one: [info] [phantom] Starting... [info] [phantom] Running suite: 3 steps [debug] [phantom] opening url: http://caspertest.grsrv.com/, HTTP GET [debug] [phantom] Navigation requested: url=http://caspertest.grsrv.com/, type=Other, willNavigate=true, isMainFrame=true [debug] [phantom] Navigation requested: url

Impossible to .sendKeys(..) with CasperJS on some sites

大憨熊 提交于 2019-12-12 05:46:33
问题 I am loosing my mind over trying to do something inherently seemingly banal, but it seems almost hopeless. For a thesis project I need to collect flight prices. This code should just fill in "zurich" to the departure box. But it doesn't. This code works normally with any text imput box, but on this simple page its hopeless. I really would appreciate someones wisdom here: // variables var casper = require("casper").create(); var x = require('casper').selectXPath; var url = 'http://www

External CSS not taken into account on PhantomJS page

▼魔方 西西 提交于 2019-12-12 05:27:59
问题 I am running Phantom on a Node server, in order to generate pages from data and then render it as pdf. However, while the pages work and are correctly rendered as pdf and everything, I cannot get them to take into account an external CSS file. Here is a simplified version of what I am trying to do: var phantom = require ('phantom'); phantom.create(function (ph) { ph.createPage(function (page) { var content = ""; content += '<html><head>'; content += '<link rel="stylesheet" href="/temp.css">';