headless

How do you run headless chrome and a proxy using selenium in python?

江枫思渺然 提交于 2019-12-08 07:12:54
问题 My python script has the headless chrome in selenium up and functional but how, if possible, can I use a proxy as well? How can I pass the proxy host port to my headless chrome browser? options = webdriver.ChromeOptions() options.add_argument('headless') browser = webdriver.Chrome(chrome_options=options) How do I use the proxy host port with selenium and mainly headless chrome? Thanks! 回答1: The simplest way to do is something like below. Put any ip address in the proxy variable to find out

Headless chrome with selenium, can only find ways to scroll non-headless

邮差的信 提交于 2019-12-08 06:13:11
问题 There is a lot to find about this subject, but can't figure this out. I need to scroll to the end of the page of a (not so long) infinity scroll. I have 2 options that work with chrome non-headless but doesn't seem to work headless. The first one which i liked the most, works beautiful and found here on SA: driver = webdriver.Chrome('c:/cd.exe', chrome_options=chrome_options) driver.get('http://www.website.com') while True: count = len(driver.find_elements_by_xpath('//div[@itemprop=

Ghostdriver actual performance gain

≡放荡痞女 提交于 2019-12-08 02:52:44
问题 I've recently switched from FirefoxDriver to GhostDriver. My test suite (roughlty around 150 end to end tests) used to take 25 minutes to run. Now with Ghostdriver it's taking 23 minutes. So in total I've gained 2 minutes of run time. It's an improvement but not as huge as I would've expected. Is such a low gain normal ? Or should I expect a much higher cut down time from switching to an headless test runner ? I'm using the .NET version of webdriver/ghostdriver. I'd be really interested to

Headless chrome with selenium, can only find ways to scroll non-headless

自作多情 提交于 2019-12-08 01:33:24
There is a lot to find about this subject, but can't figure this out. I need to scroll to the end of the page of a (not so long) infinity scroll. I have 2 options that work with chrome non-headless but doesn't seem to work headless. The first one which i liked the most, works beautiful and found here on SA: driver = webdriver.Chrome('c:/cd.exe', chrome_options=chrome_options) driver.get('http://www.website.com') while True: count = len(driver.find_elements_by_xpath('//div[@itemprop="itemListElement"]')) print(count) driver.execute_script("window.scrollTo(0, document.body.scrollHeight);") try:

Eclipse CDT Headless build hangs after build is finished

杀马特。学长 韩版系。学妹 提交于 2019-12-07 20:02:00
问题 I am in the process of implementing a Continuous Integration Server for our embedded application built with the GNU-ARM toolchain with the GNU-ARM-ECLIPSE plugin. Therefore, I need to compile our CDT project from the command line on the server (I want to compile the Debug, Release and UnitTests builds, and then run the tests). I was planning to use the Eclipse Headless builds (see here). The problem I am getting is that after building, I don't get the prompt back (on windows CMD or Powershell

Java Headless Exception after setting -Djava.awt.headless=true

痞子三分冷 提交于 2019-12-06 13:47:40
I am using: Linux Debian 6, Java 1.6.29 and Tomcat 6 I've seen many posts about it explaining that java.awt requires X11 libraries..etc., but they are not solving the problem. I set -Djava.awt.headless=true in my box and I worked around the first problem of the headless environment, now I am getting: java.awt.HeadlessException java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159) java.awt.Window.(Window.java:432) java.awt.Frame.(Frame.java:403) javax.swing.JFrame.(JFrame.java:202) org.jfree.ui.ApplicationFrame.(ApplicationFrame.java:65) ... I know by doing this I just told

Ghostdriver actual performance gain

爱⌒轻易说出口 提交于 2019-12-06 12:47:14
I've recently switched from FirefoxDriver to GhostDriver. My test suite (roughlty around 150 end to end tests) used to take 25 minutes to run. Now with Ghostdriver it's taking 23 minutes. So in total I've gained 2 minutes of run time. It's an improvement but not as huge as I would've expected. Is such a low gain normal ? Or should I expect a much higher cut down time from switching to an headless test runner ? I'm using the .NET version of webdriver/ghostdriver. I'd be really interested to compare this "benchmark" with anyone having recently switched to GhostDriver GhostDriver won't offer any

Eclipse CDT Headless build hangs after build is finished

喜你入骨 提交于 2019-12-06 11:07:15
I am in the process of implementing a Continuous Integration Server for our embedded application built with the GNU-ARM toolchain with the GNU-ARM-ECLIPSE plugin. Therefore, I need to compile our CDT project from the command line on the server (I want to compile the Debug, Release and UnitTests builds, and then run the tests). I was planning to use the Eclipse Headless builds ( see here ). The problem I am getting is that after building, I don't get the prompt back (on windows CMD or Powershell), and so I cannot run the tests. And also, the CI server complains that the build was not successful

Cucumber headless xvfb ubuntu

巧了我就是萌 提交于 2019-12-06 06:54:31
问题 I'm trying to setup a Jenkins build server on Amazon EC2. I'm planning on running my cucumber test suite in headless mode. I was successfully able to run headless in IRB require 'watir-webdriver' require 'headless' headless = Headless.new headless.start b = Watir::Browser.new(:chrome) b.goto("www.google.com") b.title b.close headless.destroy but if I add the following to my env.rb if ENV['HEADLESS'] require 'headless' headless = Headless.new headless.start at_exit do headless.destroy end end

How to fix NoClassDefFoundError: CircularOutputStream error?

落爺英雄遲暮 提交于 2019-12-05 13:40:34
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>(FirefoxBinary.java:60) at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:56) at org