phantomjs

Selenium and PhantomJS Error: “Cannot connect to GhostDriver”

一曲冷凌霜 提交于 2019-12-10 17:25:58
问题 I am running Selenium and PhantomJS to input search terms into a website and retrieve the number of hits for each search term. I have to do this 130,000+ times, so the code has been running nicely for a day until suddenly the program broke with the following error: Traceback (most recent call last): File "CBBPlyNwsScrape.py", line 82, in <module> browser = webdriver.PhantomJS() File "/Library/Python/2.7/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 50, in __init__ self

chromedriver works but “phantomjs unable to locate item using css selector”

穿精又带淫゛_ 提交于 2019-12-10 17:03:24
问题 I'm designing some end to end testing for my job, and I've got it up and running using nightwatch.js through chromedriver. However, we're looking to have this run on our servers, and so I wanted to be able to run it using phantomjs. Although the test performs without incident using chromedriver, Phantomjs yields the following error "phantomjs unable to locate item using css selector" Any ideas? I've scoured the internet for a solution, to no avail. 回答1: First, check decates ' comment here:

Net::ReadTimeout: Net::ReadTimeout and Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start on Rails 5.1.beta System Test

我与影子孤独终老i 提交于 2019-12-10 16:44:24
问题 Enthusiastic about the baking of Capybara into the new version of Rails (5.1) cf http://weblog.rubyonrails.org/2017/2/23/Rails-5-1-beta1/ I have run into a problem though. Here are my steps. Any clue welcome. Brand new install of: Linux Ubuntu Desktop 16.10 (VM on Hyper-V), with Chrome installed and running fine; Ruby 2.4; Rails 5.1.beta. 1.- Create a simple app: ~$ ruby -v ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux] ~$ rails -v Rails 5.1.0.beta1 ~$ mkdir railsapps ~$ cd railsapps

enable cookies in Phantomjs + selenium

隐身守侯 提交于 2019-12-10 16:37:49
问题 I want to login in amazons3 (with the url:'https://console.aws.amazon.com/iam/home?#security_credential') on my armv7 board.I used phantom2.0.1 from here and selenium2.45.0. I can open the website successfully, but when I doing 'submit' after filling the username and password, the website jump to an error page which shows ‘Please Enable Cookies to Continue’. So I wonder how to enable cookies for phantomjs in selenium.In my ubuntu12.04 with suitable version of phantomjs, I can succeed Part of

PHantom JS fails 50% of the time

二次信任 提交于 2019-12-10 16:13:18
问题 I search for a textbox and then try to fill it with a string . Here's the code : var fname = _driver.FindElement(By.Name("iFirstName"), 50); if(fname!=null) { do { System.Threading.Thread.Sleep(500); } while (!fname.Displayed); fname.SendKeys(myName); } The FindElement function is this : public static IWebElement FindElement(this IWebDriver driver, By by, int timeoutInSeconds) { if (timeoutInSeconds > 0) { var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(timeoutInSeconds)); return

CasperJS : dropdown list; select an option, code works in browser&slimer but not with phantom

坚强是说给别人听的谎言 提交于 2019-12-10 15:59:24
问题 Here my problem : I'm in a specific case where I try to set the option of a select dropdown list. I usually use this.mouse.up() + this.mouse.down() but I can't in this case because this behavior doesn't work on the website with webkit (you can compare the two with google chrome and Firefox). Here the url : I want to set the field 'ANNEE' to a year, 2008 in my example My code : (my function changes the HTML and launches the change() event) //custom function casper.fillSelect = function

Set Accept-Language on PhantomJSDriver in a Play Framework Specification

最后都变了- 提交于 2019-12-10 15:54:29
问题 How can the PhantomJSDriver be configured with a specific Accept-Language language header in a Play Framework 2.2 specification? Given this code: import org.specs2.mutable._ import org.specs2.runner._ import org.junit.runner._ import play.api.i18n._ import play.api.test._ import play.api.test.Helpers._ import org.openqa.selenium.phantomjs.PhantomJSDriver @RunWith(classOf[JUnitRunner]) class IntegrationSpec extends Specification { "Application" should { "work from within a browser" in new

How do I get selenium-webdriver to ignore SSL errors in Firefox and PhantomJS?

☆樱花仙子☆ 提交于 2019-12-10 15:39:43
问题 Given these Node dependencies: { "chromedriver": "^2.24.1", "cucumber": "^1.3.0", "geckodriver": "^1.1.2", "phantomjs-prebuilt": "^2.1.12", "selenium-webdriver": "^3.0.0-beta-2" } I would like PhantomJS and Firefox to ignore SSL certificates. Here is how my browser.js looks: require('geckodriver'); // main browser object var browserHandle; // load selenium webdriver and some rules var webdriver = require('selenium-webdriver'), By = webdriver.By, until = webdriver.until; // load phantomjs into

How to go to the next page for scraping in PhantomJS

社会主义新天地 提交于 2019-12-10 15:33:49
问题 I'm trying to get several elements from a website with several pages. I'm currently using PhantomJS to do that work and my code almost works, but the issue is that my code scrapes twice the first page even if (according to the log) it seems that I already moved to the second one. Here's the code: var page = require('webpage').create(); page.viewportSize = { width: 1061, height: 1000 }; //To specify the window size page.open("website", function () { function fetch_names(){ var name = page

PhantomJS caching. Where it is stored?

孤街浪徒 提交于 2019-12-10 15:16:31
问题 I am using PhantomJS to parse some sites. Given a URL, I parse it and then I start other instances to parse related URLs (same host/domain). I see that the time of loading the page is quite big, so I was digging into the --disk-cache option. My question is: Where is that cache stored? I am launching my PhantomJS instances from a Rails app in Heroku, and I would like to know where is that cache stored (which directory). 回答1: Check on below path : Linux : ~/.qws/cache/Ofi Labs/PhantomJS Windows