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.
Questions tagged [google-chrome-headless]
1156 questions
10
votes
0 answers
Cannot start Chromium in AWS Lambda container but works locally
I am trying to set up a headless Chromium browser in AWS Lambda using a docker container. My Dockerfile looks like this
# Build stage
# ------------
FROM public.ecr.aws/lambda/nodejs:14 AS builder
RUN yum install -y make
# Install dependencies
ENV…

Jozef Cipa
- 2,133
- 3
- 15
- 29
10
votes
1 answer
Website access denied using puppeteer on cloud functions
I am trying to scape this url https://www.myntra.com/laptop-bag/chumbak/chumbak-unisex-brown-geo-bird--printed-laptop-bag/6795882/buy using puppeteer.
It's working when i use { headless: false }, but failing in headless mode.
Then i have compared…

vjnan369
- 833
- 16
- 42
10
votes
4 answers
What is the difference in accessing Cloudflare website using ChromeDriver/Chrome in normal/headless mode through Selenium Python
I have a question about --headless mode in Python Selenium for Chrome.
Code
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
CHROME_DRIVER_DIR = "selenium/chromedriver"
…

Максим Дихтярь
- 151
- 1
- 1
- 8
10
votes
1 answer
Why Puppeteer needs --no-sandbox to launch Chrome in Cloud Functions
When I run Puppeteer on Cloud Functions with Node 8, I get this error.
Error: Failed to launch chrome!
[1205/063825.588245:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See…

skynew
- 380
- 3
- 13
10
votes
2 answers
How to wait for all images to load from page.evaluate function in puppeteer when the DOM is populated using a client side function
I am trying to make the code execution wait for all images to load before puppeteer takes a screenshot. My DOM gets populated when initData() function is called, which is defined in the client side js file. Delay or timeout is an option but I am…

Naitik Adani
- 226
- 2
- 10
10
votes
1 answer
Localhost connection refused when accessing headless chrome instance from docker container using puppeteer (run locally)
I am running headless chrome in a docker container and accessing it through puppeteer by running it locally using browerWSEndpoint. This part works fine. Once I get the connection established I try to use the instance to go to a localhost:port which…

user3674212
- 187
- 1
- 1
- 5
10
votes
6 answers
NoSuchElementException with headless chrome and selenium
I am trying to use headless chrome for our selenium tests and have made the below changes:
DesiredCapabilities desiredCapabilities = DesiredCapabilities.chrome();
ChromeOptions options = new…

mishra
- 199
- 1
- 2
- 8
10
votes
4 answers
Puppeteer get request redirects
Is there any way to use puppeteer to get the redirects with the response body (if there are any) of the request?
I implemented the following code but I can't find a way to get the redirects...
const page = await browser.newPage()
page.on('request',…

Valip
- 4,440
- 19
- 79
- 150
10
votes
5 answers
Chrome Headless in Unix returns empty page source
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…

Sivaram Kumar
- 321
- 3
- 11
10
votes
1 answer
Using page.getMetrics() to get page load time in puppeteer
I am trying to use puppeteer to measure how fast a set of web sites loads in my environment. My focus is on the quality of network connection and network speed, so I am happy to know the the time taken for a page to load, for a layman's definition…

Raj
- 319
- 3
- 12
10
votes
2 answers
Headless Chrome REPL not working
When I try to run:
google-chrome --headless --disable-gpu --repl http://google.com
getting infinite:
[0829/155519.758686:INFO:headless_shell.cc(303)] Type a Javascript expression to evaluate or "quit" to exit.
>>>…

Jonas
- 4,683
- 4
- 45
- 81
9
votes
5 answers
Element not interactable in Selenium Chrome Headless Mode
My code is working all fine when I don't run chrome in headless mode, but in headless mode I get 'Element not interactable'.
I get error at email_box.send_keys('')
And I have set the window size, still it is not working
Code:
from selenium.webdriver…

Mubbashir Ali
- 311
- 3
- 7
9
votes
2 answers
Chrome download error when downloading file with Puppeteer
I have an application that shows a page, the user clicks on a button, and downloads a CSV file. I want to run this with Puppeteer.
Problem is that the CSV is downloaded empty and with an error. This happens both with headless true and false. The…

ps0604
- 1,227
- 23
- 133
- 330
9
votes
1 answer
Google Chrome Headless Error "Not supported" When using getDisplayMedia trying to record screen from Chrome Tab in Puppeteer
I am using Puppeteer latest version with Chromium 80 and I'm trying to record video from page in chrome headless and turned on all these flags:
{
headless: true,
devtools: false,
args: [
'--no-sandbox',
'--allow-insecure-localhost',
…

Hirad Nikoo
- 1,599
- 16
- 26
9
votes
1 answer
Puppeteer - How to connect WSEndpoint using local IP address?
I have two Node.js scripts for puppeteer automation.
1) launcher.js
This Puppeteer script launches a chrome browser and disconnects the chrome so that it can be connected by using WSEndpoint.
const puppeteer = require('puppeteer');
module.exports…

NIKHIL C M
- 3,873
- 2
- 28
- 35