Skip to content
← Back to Community
This time we *are* getting puppeteer
Profile icon
h
has Hacker Plan
Coder100

This time puppeteer is going to save

Hello everyone! Just yesterday I installed node.js locally on my computer for some Heroku business: https://arcane-peak-83337.herokuapp.com/ which also ultimately caused the empty repl project! Today, we are going to be going above that. WE are going to use puppeteer! Before, you had to go to pygame and use webbot. Now we are going to use bash, and use puppeteer which is way better because you are using node.js.

Recreation

npm init

Fill in questionnaire and you should have a package.json

npm install puppeteer --save

This is where we get puppeteer.

npm install puppeteer --save && npm start

JK this is how we do the real stuff. We install then run.

const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch({ headless: false, args: ['--no-sandbox', '--disable-setuid-sandbox'] }); const page = await browser.newPage(); page.goto("https://repl.it/"); // More commands here... /* You may view the docs at: https://devdocs.io/puppeteer/ And more magic at: https://www.npmjs.com/package/puppeteer Github: https://github.com/puppeteer/puppeteer */ // await browser.close(); })();

Real easy here, you just do the stuff. Notice on line 4. These args are absolutely necessary due to some restrictions set out by repl.it I think this is the reason for --no-sandbox because if you leave that out, you get some cryptic errors.


Enjoy!

Fork and let's unblock some things! may I suggest surviv?

Please vote up if you liked this tutorial of sorts!

Happy unblocking!

Giving credit

This was made entirely by me and you can give credit by putting

// This REPL was made thanks to repl.it/@Coder100/This-time-we-are-getting-puppeteer // Go fork it and check it out!

Some side comments

For embedding, try ?lite=true&outputonly=1

Voters
Profile icon
Bhone-MM
Profile icon
waki285
Profile icon
Abdullah2222
Profile icon
juansegnana
Profile icon
Apenasgabs
Profile icon
shirser121
Profile icon
codingjlu
Profile icon
janniklth
Profile icon
Tibbbb2
Profile icon
ueredeveloper
Comments
hotnewtop
Profile icon
hazelpy

Yo hell yeah surviv! Man I'm so glad this works, I'll use this during school fno lol

Profile icon
Coder100
Profile icon
moni13

doesn't work on me

Profile icon
Evanlicious

@Coder100 I actually just made something like this a day ago, you can just run Chromium from a .sh file on repl.it. All you have to do is type in "chromium-browser --no-sandbox" and it's done.

Profile icon
Coder100

Well yeah, but can you automate it? Also, this build of chrome appears to be on a chromebook @Evanlicious

Profile icon
Evanlicious

@Coder100 You might be able to, but I am not sure.

Profile icon
Coder100

hmmm ill look at that @Evanlicious

Profile icon
SilentShadowBla

This seems really cool but can someone explain how it works :) thx

Profile icon
Coder100

What part do you not understand? We have to use all those await things because node.js is asynchronous by default, so without them, it will open and close at the same time really bad @SilentShadowBla

Profile icon
nodexninja

Wait this actually worked.

Profile icon
Coder100

@nodexninja yep that's how working works

Profile icon
qaiik

I am using automation to unblock, get the headers normally used when requesting, and use them

Profile icon
shirser121

You help me so much!
Thank you!!
I have no words to say how much you help me!

Profile icon
Blankjp

How do you see the output?

Profile icon
MarioX

show how enable/install/execute puppeteer-core + chrome with plugins enable
https://repl.it/talk/share/fixing-puppeteer-core-and-chrome-with-plugins/84218

Profile icon
johniskander

I got this error :
TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r722234 is guaranteed to work.

have any idea why ?

Profile icon
mwilki7

what does this do?

Profile icon
hazelpy

@mwilki7 unblock tool for school/work computers

Profile icon
Coder100

Yes, and also automation things but unblocking is more fun lol @hazelpy

Profile icon
RohilPatel

Noice!