Skip to content
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

Work on Linux #1

Open
rrajiv opened this issue Nov 7, 2017 · 1 comment
Open

Work on Linux #1

rrajiv opened this issue Nov 7, 2017 · 1 comment

Comments

@rrajiv
Copy link
Owner

rrajiv commented Nov 7, 2017

Currently this works only on Mac/local machine. Set this up so that it can work on linux/vm

@gippal617
Copy link

Install chrome. Use these 2 guides:
https://askubuntu.com/questions/510056/how-to-install-google-chrome
puppeteer/puppeteer#404
If you do it right, you can use command such as google-chrome --version or google-chrome --help and see output.

After that get latest nodejs. I used this way:
https://nodejs.org/en/download/current/
Search for latest 64-bit linux binaries, e.g.
https://nodejs.org/dist/v9.1.0/node-v9.1.0-linux-x64.tar.xz
Download & extract with command such as “tar xvf”
Go to ~/.profile and add permanent path for binary folder of nodejs, e.g.:
PATH="$HOME/bin:$HOME/.local/bin:$HOME/node-v9.1.0-linux-x64/bin:$PATH"
Log out & login again, then verify versions of node & npm in command line.

Next, modify code to ensure you are using headless chrome. See sample here:
const browser = await puppeteer.launch({
headless: true,
slowMo: 250 // slow down by 250ms
});
SET HEADLESS TO TRUE, NOT FALSE!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants