-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ubuntu 18.04 Headless Chrome Node API - Puppeteer - Installation Guide #3443
Comments
Based on https://github.com/GoogleChrome/puppeteer You only have to run the following command in Ubuntu 18.04
Unfortunately this is not enough. You will require the following Dependencies
After which if you run it as per their example , you will receive an error
The solution to this is
Adding --no-sandbox It will work accordingly then. The full working source code is below
|
how to handle captcha with headless chrome puppeteer |
This works :) |
Thanks a lot, it works. |
i think you can also try this way: const broswer = await puppteer.launch({
executablePath:path.resolve(__dirname,'../node_modules/puppeteer/.local-chromium/linux-650583/chrome-linux/chrome')
}); my enviroment is ubuntu 16.04,you can add the path to the puppteer |
@fireairforce this never worked for me :/
|
const browser = await puppeteer.launch({args: ['--no-sandbox']}); you can try this way? |
@fireairforce Yes now going to try that one 🦅 and for that i have do first
|
works :) |
Which one worked for you? |
**i just install dependencies; on my ubuntu live server ** |
Im running BugBuntu 18.04 and none of that is need it const puppeteer = require('puppeteer');
(async () => {
try {
const browser = await puppeteer.launch({
headless: false
})
const page = await browser.newPage();
await page.goto('https://www.instagram.com');
await page.screenshot({path: 'example.png'});
} catch (error) {
console.log('error: ', error);
}
})(); |
With puppeteer 3.0.0+ I also had to install libgbm-dev as a dependency
|
I found that with the latest version of puppeteer 3+ which uses the latest chromium, I had to do the following on Ubuntu 20.
In docker I had to add the following to my Docker file:
I also had to add the argument '--no-sandbox' when calling puppeteer. |
It is easier if you just install |
I tried a simple and crude way, it works: |
This was the only solution working within my rabbitmq:management container. I like your solution because it's simple and short. |
Hello, it also won't work for me, I get the same error (Error: Could not find browser revision 737027. Run "npm install" or "yarn install" to download a browser binary.) Could you please help me? I did everything you told ^ up... |
@Rainbowhat |
|
Worked for me, thanks @impressto |
I've had the same problem on Ubuntu 20.04. Fixed with installing these packages sudo apt-get update
sudo apt-get -y --no-install-recommends install libxrandr2 libatk1.0-0 libatk-bridge2.0-0 libx11-xcb1 libxcb-dri3-0 libxcomposite1 libxcursor1 libxdamage1 libcups2 libdrm2 libgbm1 libgtk-3-0 And it's possible to see the list of missing libraries with ldd ldd ./node_modules/puppeteer/.local-chromium/linux-782078/chrome-linux/chrome | grep "not found" |
this worked for me |
this actually worked for me on Digital Ocean Droplet! |
I am unable to solve the problem with these steps. Pasting the output of npm i puppeteer
Refer https://stackoverflow.com/questions/64043249/failed-to-launch-chromium-headless-using-puppeteer-on-ubuntu-16-04-aws-ec2-insta for more details |
Thank you so much. This worked for me on ubuntu 18.04. |
i fix it!!! |
Installing
|
install puppeteer dependencies launch puppeteer with no-sandbox ref: puppeteer/puppeteer#3443 (comment)
install puppeteer dependencies launch puppeteer with no-sandbox ref: puppeteer/puppeteer#3443 (comment)
install puppeteer dependencies launch puppeteer with no-sandbox ref: puppeteer/puppeteer#3443 (comment)
install puppeteer dependencies launch puppeteer with no-sandbox ref: puppeteer/puppeteer#3443 (comment)
* Browser tests with Puppeteer rather than Selenium * try headless puppeteer * fixed ci fail (#1654) install puppeteer dependencies launch puppeteer with no-sandbox ref: puppeteer/puppeteer#3443 (comment) * Update dependencies * give a title to install steps * increase sleep time in test * relax test timing Co-authored-by: Hong, Jian-Ching <allyusd@users.noreply.github.com>
Its works after install chromium: |
I ran sudo npm i puppeteer on Ubuntu 18.04
Sample Script
Node
v8.10.0
Fix for Above Error
sudo npm install --unsafe-perm
New Error Below
The text was updated successfully, but these errors were encountered: