Horje
puppeteer open browser authentication facebook Code Example
puppeteer open browser authentication facebook
if (!Object.keys(cookies).length) {await page.goto("https://www.facebook.com/login", { waitUntil: "networkidle2" });await page.type("#email", config.username, { delay: 30 })await page.type("#pass", config.password, { delay: 30 })await page.click("#loginbutton");await page.waitForNavigation({ waitUntil: "networkidle0" });await page.waitFor(15000);try {await page.waitFor('[data-click="profile_icon"]');} catch (err) {console.log("failed to login");process.exit(0);}let currentCookies = await page.cookies();fs.writeFileSync('./cookies.json', JSON.stringify(currentCookies));} else{//User Already Logged In}




Javascript

Related
swagger next js Code Example swagger next js Code Example
node-google-spreadsheet color border Code Example node-google-spreadsheet color border Code Example
code converter from javascript to typescript Code Example code converter from javascript to typescript Code Example
javascript class prototype Code Example javascript class prototype Code Example
edit a json file in nodejs Code Example edit a json file in nodejs Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8