DEV Community

Discussion on: Web Scraping — Scrape data from your instagram page with Nodejs, Playwright and Firebase.

Collapse
spidydev profile image
Cicada1033➿

go to your project directory
using the terminal,run the command below,
npx playwright open --save-storage websitename.json

a browser will open,now navigate to the website and sign-in/solve captcha,
then close browser. You will notice that a file "websitename.json" has been created.

now in playwright,set you browser context using this code below

const context = await browser.newContext({
storageState: "websitename.json"
});

you are now automatically logged in. :)