google-chrome-headless

How to set value of select with node Puppeteer

限于喜欢 提交于 2019-12-07 06:47:45
问题 I am trying to do some automation with the rather new GoogleChrome/puppeteer library, but I cannot figure out how to set a value in a select field. Here is my (simplified) function to set the value of a text input: async function setInputVal(sel, text) { await page.focus(sel) page.press('Backspace') page.type(text) } await setInputVal('input.searchjob', task.id) I cant figure out how to do the same for a select field. I have tried to set the focus, insert script and execute but I cannot get

Chrome Headless Doesn't work

一笑奈何 提交于 2019-12-07 01:08:59
问题 I've read about the Chrome Headless from developers.google said we can run the Google without UI. Quote from that link : Headless Chrome is shipping in Chrome 59. It's a way to run the Chrome browser in a headless environment. Essentially, running Chrome without chrome! It brings all modern web platform features provided by Chromium and the Blink rendering engine to the command line. Why is that useful? A headless browser is a great tool for automated testing and server environments where you

Capybara headless chrome in docker returns DevToolsActivePort file doesn't exist

喜夏-厌秋 提交于 2019-12-06 17:45:26
问题 Im trying to configure system tests to work with headless chrome in selenium. I have the following capybara configuration: # spec/support/capybara.rb Capybara.server = :puma, { Silent: true } RSpec.configure do |config| config.before(:each, type: :system) do driven_by :rack_test end config.before(:each, type: :system, js: true) do driven_by :selenium_chrome_headless, screen_size: [1400, 1400] end end and the following Dockerfile (no database because i'm using the host for this): FROM ruby:2.5

Selenium with chromedriver gives different results based on “headless” argument

☆樱花仙子☆ 提交于 2019-12-06 12:37:53
I have been playing around with Selenium + Chromedriver and I noticed I get different results based on if headless is enabled or disabled. After some investigation I found out that "headless" does not include the Accept-Language header. Is there anyway to manually add this in the headers? DrStrangelove That's what Google chrome does. One way around it would be to use a proxy and modify the headers for you. Or you can use the Firefox driver as that driver does not send different headers when using the headless option. Ideally, using and not using the --headless option shouldn't have any major

Chrome 73 stop supporting headless mode in background scheduled task?

℡╲_俬逩灬. 提交于 2019-12-06 08:39:38
问题 We have a .NET program to run headless Chrome to snapshot web page to image, and here is the sample code: class Program { static void Main(string[] args) { var p = Process.Start( @"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", $@"--headless --screenshot=E:\test{DateTime.Now:HHmmss}.png --disable-gpu --window-size=320,568 http://www.microsoft.com"); p.WaitForExit(); } } The console application is scheduled in Windows Task Scheduler with "Run whether user is logged on or not"

How to access a site via a headless driver without being denied permission

有些话、适合烂在心里 提交于 2019-12-06 06:35:32
问题 I am trying to retrieve the html code of a site using a headless chrome driver. However I get a "permission denied" message. If I use a "regular" driver it all works fine. Is there any way to bypass that? It's my first post so I do apologize for any potential mistakes in formatting from selenium import webdriver #Headless driver chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--headless') chrome_options.add_argument('--no-sandbox') driver1 = webdriver.Chrome(executable

Headless chrome web driver too slow and unable to download file

a 夏天 提交于 2019-12-05 23:59:26
I am trying to download a file using python headless chrome web driver. My code is running to slow.There is no output(downloaded) file. I am getting no error. Any help would be appreciated. here is my code: # Getting All User Credintials for x in range(2,st.max_row + 1): Users.append([st.cell(x, 1).value,st.cell(x, 2).value, st.cell(x, 3).value]) # Looping through Users for item in Users: try: chrome_options = Options() chrome_options.add_argument("--headless") prefs = {"download.default_directory": os.getcwd()} chrome_options.add_experimental_option("prefs", prefs) chrome = webdriver.Chrome

ElementNotVisibleException when use headless Chrome browser

霸气de小男生 提交于 2019-12-05 16:43:32
问题 When I run test script in headless mode chrome browser, element link is not visible, is not able to do linkElement.click() . in head mode is everything OK. All other info are in stacktrace. Anyone knows what to do, please? StackTrace: ERROR occurred: Message: element not visible (Session info: headless chrome=60.0.3112.90) (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 6.1.7601 SP1 x86_64) Traceback (most recent call last): File "C:\nik-x

How to dump more than <body> on chrome / chromium headless?

青春壹個敷衍的年華 提交于 2019-12-05 05:38:54
Chrome's documentation states: The --dump-dom flag prints document.body.innerHTML to stdout: As per the title, how can more of the DOM object (ideally all) be dumped with Chromium headless? I can manually save the entire DOM via the developer tools, but I want a programmatic solution. Update 2019-04-23 Google was very active on headless front and many updates happened The answer below is valid for the v62 current version is v73 and it's updating all the time. https://www.chromestatus.com/features/schedule I highly recommend checking puppeteer for any future development with headless chrome. It

Headless chrome with python suspends when trying to download a file

无人久伴 提交于 2019-12-05 03:53:59
I'm using Python, Jupyter, Selenium webdriver and headless chrome (with Canary) on Mac. I wrote a script that scrapes a very old website, In order to download a file from that website I need to click on several buttons which eventually lead me to a button that once clicked it downloads a CSV file The problem is that when headless chrome tries to download the target file it suspends and does nothing (i.e. doesn't download the required file) even though the script finished running (and yes I did close it at the end of the script) I tried: Downloading other files (from different websites) and