Questions tagged [google-chrome-headless]

Chrome Headless is the headless mode of Chrome and Chromium used for automation, testing, and CI scenarios. Use this tag for questions related to the usage of Chrome Headless and the DevTools protocol.

1156 questions
21
votes
0 answers

Is it possible to install Headless Chrome without X11 dependencies?

I wonder if is it possible to somehow install Headless Chrome without X11 dependencies, e.g. on a VM or in a Docker container? Currently when I install it from the Chrome repo it downloads lots of useless stuff as dependencies. It takes a long time…
20
votes
1 answer

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

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,…
user1213904
  • 1,830
  • 4
  • 23
  • 39
20
votes
2 answers

How to add the chrome binary to run e.g. Karma tests on headless chrome on a CI server

I like to run my karma unit tests on a headless chrome. Using karma-chrome-launcher and setting the browser to "ChromeHeadless" works on my machine. But on the CI server it fails with the message "No binary for ChromeHeadless browser on your…
19
votes
1 answer

What does the argument --virtual-time-budget of Chrome CLI really mean?

I'm aware of the documentation of the argument --virtual-time-budget in the source of Chromium, but I don't feel I understand it: // If set the system waits the specified number of virtual milliseconds before // deeming the page to be ready. For…
Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
19
votes
4 answers

ChromeDriver --print-to-pdf after page load

According to the docs, Chrome can be started in headless mode with --print-to-pdf in order to export a PDF of a web page. This works well for pages accessible with a GET request. Trying to find a print-to-pdf solution that would allow me to export a…
18
votes
2 answers

Is there any way to record a video of website using headless Chrome?

I know there is a way to make screenshots, using many available APIs, such as Puppeteer https://github.com/GoogleChrome/puppeteer but what about recording videos? my goal is to capture a CSS animation into an mp4 file. Or am i doing it all wrong,…
Mikhail Novikov
  • 623
  • 2
  • 9
  • 23
18
votes
1 answer

How do I Specify PDF Output Path in Chrome Headless Mode

This page shows that you can now use chrome to generate a PDF of a webpage using the following CLI command: chrome --headless --disable-gpu --print-to-pdf https://www.chromestatus.com/ However, it does not state how to specify the output path. How…
Cody G
  • 8,368
  • 2
  • 35
  • 50
17
votes
1 answer

Running "google-chrome" on WSL Ubuntu as --headless --no sandbox gives multiple errors - how do I take screenshot using headless in WSL?

I'm running Windows 10 and I have been using an Ubuntu Linux distro under the Windows Linux Subsystem. I want to be able to use Chrome.exe or google-chrome to run headless and take screenshots, generate pdfs etc... as part of library calls, but…
16
votes
6 answers

How to detect version of chrome used with puppeteer?

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…
16
votes
3 answers

How can I dynamically inject functions to evaluate using Puppeteer?

I am using Puppeteer for headless Chrome. I wish to evaluate a function inside the page that uses parts of other functions, defined dynamically elsewhere. The code below is a minimal example / proof. In reality functionToInject() and…
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
16
votes
8 answers

Unable to locate elements on webpage with headless chrome

I have a script that's accessing printers, and my code works totally fine when chrome is run normally, but when it's run headless, selenium can't seem to find elements on the webpage. Here's the relevant code: init method: def __init__(self,…
15
votes
1 answer

Headless chromium in ubuntu docker container

I am trying to run a headless instance of chromium within an ubuntu docker image but I keep getting the error this system has no display nor audio inputs or outputs [0307/003516.533150:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to…
maxwellpwang
  • 163
  • 1
  • 1
  • 6
15
votes
2 answers

Pupeteer - how can I accept cookie consent prompts automatically for any URL?

When taking a screenshot of a website using pupeteer, cookie consent prompts are displayed. I want to dismiss or accept these prompts before taking the screenshot. The problem I am facing is that most websites present the cookie prompt in different…
drs
  • 1,165
  • 3
  • 13
  • 19
15
votes
2 answers

Selenium: How to use Headless Chrome on AWS?

Today I saw the message UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead. I am willing to for for Chrome route. How do I install on AWS and run it on my remote AWS instance? I…
Volatil3
  • 14,253
  • 38
  • 134
  • 263
15
votes
1 answer

await page.cookies() not returning cookies seen in response header

I am executing a basic puppeteer script that opens a webpage looks at response values and then pulls the cookies. In the example below the response header has the following key values: page.on('response', response => { const req =…
Matthew Essenburg
  • 236
  • 1
  • 2
  • 6
1 2
3
77 78