DEV Community

Discussion on: Optimizing and Deploying Puppeteer Web Scraper

Collapse
 
apanjwani0 profile image
Aman Panjwani

Hii, I am making an instagram scraping tool.
Instagram divs weren't loading in headless:true mode, than I changed to puppeteer-extra and added stealth plugin. Everything worked fine on localhost, thanks to you.

But, unfortunately when deployed to heroku, the divs are not loading again, even page.waitForSelector shows timeout error.

PS-: 1) I've added the args: ['--no-sandbox']
2) I've also added github.com/jontewks/puppeteer-hero... buildpack in my heroku-app-settings.

Link to my project-: github.com/apanjwani0/Scrape-Insta...

Thanks in advance !

Collapse
 
olcay97 profile image
Olcay Gören

did you find any solution for that?

Collapse
 
apanjwani0 profile image
Aman Panjwani

No, I thought maybe dockerizing my project would solve the issue (that way we can also run headless:false), but never continued with the project.
Do let me know if it works for you, or you find any other solution.

Thread Thread
 
alireza4130 profile image
Alireza

await page.goto(BASE_URL, { waitUntil: "networkidle0" })

waitUntil: "networkidle0" is nessary for this issue and set the headless to new