google-chrome-headless

Selenium grid sessions not applied

こ雲淡風輕ζ 提交于 2019-12-13 03:36:23
问题 I'm using Selenium stanalone + Chrome headless + PHP + UwAmp server on my computer to parse some data (system: WIN7_32bit, 4GB RAM). I need to start 22 Chrome sessions at the same time so I'm using selenium grid with this settings: java -jar selenium-server-standalone-2.53.1.jar -role hub java -jar selenium-server-standalone-2.53.1.jar -role node -hub http://localhost:4444/grid/register -browser "browserName=chrome,maxInstances=22,seleniumProtocol=WebDriver" -maxSession 22 My problem is that

How to pass userDataDir profile folder to Puppeteer

情到浓时终转凉″ 提交于 2019-12-13 00:02:18
问题 I want to pass a custom profile to Puppeteer. To start I've tried to pass my real Google Chrome profile: const browser = await puppeteer.launch({ userDataDir: '/Users/[USERNAME]/Library/Application Support/Google/Chrome/Default', headless: false, slowMo: 250, ... } but when the browser opens if I go to Settings it shows Person 1 rather than the data from my Google Chrome profile The userDataDir path above is what is shown in Profile Path when on Google Chrome I visit chrome://version (where

Chrome Headless in Unix returns empty page source

我与影子孤独终老i 提交于 2019-12-12 10:36:02
问题 Am using Chrome Headless to run my selenium test script in Unix machine(Cent OS).But the same script works perfectly in my local windows machine. But in Unix machine it returns empty page source like empty html tags. Have no clue where its error-ed out though am using latest ChromeDriver 2.33, and google chrome version 62.0.. System.setProperty("webdriver.chrome.driver", "/../chromedriver.exe"); --chromedriver.exe for windows local machine -- chromedriver for unix machine ChromeOptions

How to detect version of chrome used with puppeteer?

ⅰ亾dé卋堺 提交于 2019-12-12 09:57:07
问题 I read that puppeteer uses the latest version of chrome with it, where can I find which version it is using ? I don't want to access navigator object on the window to get it. Basically nothing runtime. Just want to know if puppeteer as a package lists out its dependency somewhere Basically, I want to look up what all CSS and javascript support I can assume to be there from other sites like 'can I use' or chrome references. 回答1: Use the browser.version() function to find out during runtime

How to set window size in Selenium Chrome Python

≡放荡痞女 提交于 2019-12-12 09:20:12
问题 The following code to resize a selenium chrome window does not work: driver.set_window_size(1920, 1080) time.sleep(5) size = driver.get_window_size() print("Window size: width = {}px, height = {}px.".format(size["width"], size["height"])) From which the output is: Window size: width = 1044px, height = 788px I've also tried using options to set the window size on driver creation (and lots of other things, seem comments below), but can't get it to work either: options.add_argument("--window

Running selenium tests in headless chrome without installing chrome browser

天涯浪子 提交于 2019-12-11 17:57:05
问题 I need to run my UI automation on the server which doesn't allow installation of any browsers. So i am planning to use headless selenium. Question is if i can run the UI automation using headless chrome but without actually installing chrome browser on the server box. Are there any other alternative options available to achieve this? Please help. 来源: https://stackoverflow.com/questions/54660044/running-selenium-tests-in-headless-chrome-without-installing-chrome-browser

Limit chrome headless CPU and memory usage

≡放荡痞女 提交于 2019-12-11 17:19:26
问题 I am using selenium to run chrome headless with the following command: system "LC_ALL=C google-chrome --headless --enable-logging --hide-scrollbars --remote-debugging-port=#{debug_port} --remote-debugging-address=0.0.0.0 --disable-gpu --no-sandbox --ignore-certificate-errors &" However it appears that chrome headless is consuming too much memory and cpu,anyone know how we can limit CPU/Memory usage of chrome headless? Or if there is some workaround. Thanks in advance. 回答1: There had been a

Puppeteer Select Link

此生再无相见时 提交于 2019-12-11 12:09:41
问题 I want to click on a link in a html page, which contains following snippet: <p>Die maximale Trefferanzahl von 200 wurde überschritten. <a href="/rp_web/search.do?doppelt">Verdoppeln Sie hier Suchergebnislimit.</a> </p> I'm setting some filters before and then I am loading the page, which loads the page I need. On that resulting page, I want to click on the link as seen in the html snippet. The js I'm trying to use is this one await Promise.all([ page.click('input#landNW'), // set a filter

Not able to open Chrome headless from Selenium

风格不统一 提交于 2019-12-11 01:48:49
问题 I am using maven here.Here is my Selenium code: DesiredCapabilities capb = DesiredCapabilities.chrome(); capb.setCapability("chrome.binary","/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"); ChromeOptions options = new ChromeOptions(); options.addArguments("--headless","--disable-gpu", "--no-sandbox","--remote-debugging-port=9222"); capb.setCapability(ChromeOptions.CAPABILITY, options); System.setProperty("webdriver.chrome.driver","/Users/nitinkumar/TEST/chromedriver"); try{

How to address “You are using an unsupported command-line flag: --ignore-certificate-errors, Stability and security will suffer” in HeadlessChrome

家住魔仙堡 提交于 2019-12-10 23:38:35
问题 I'm trying to run chrome headless using selenium in C# but I keep getting this error: You are using an unsupported command-line flag: --ignore-certificate-errors, Stability and security will suffer. I'm using Chrome: 61 ChromeDriver: 2.3 Selenium: 3.6 .Net 4.5 My code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using OpenQA