Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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}
Comment

PREVIOUS NEXT
Code Example
Javascript :: ./node_modules/browserify-zlib/lib/index.js 
Javascript :: detecter un click sur un bouton en jquery 
Javascript :: page slug vuejs 
Javascript :: break string to array javascript without delimeter 
Javascript :: filtering array of friends javascript 
Javascript :: draw diamond in typescript 
Javascript :: yellow fever mosquities 
Javascript :: how to draw square to the center in canvas 
Javascript :: karma error parent child 
Javascript :: knockout framework 
Javascript :: advantage of array 
Javascript :: content disposition attachment javascript fetch download "excel" 
Javascript :: append rotated triangle in anchor tag 
Javascript :: Trouble setting up sample table. “Could not find matching row model for rowModelType clientSide” 
Javascript :: handleauthenticateasync unit test 
Javascript :: isogram 
Javascript :: d3js circle out of scrren 
Javascript :: inject firebase in angularjs 
Javascript :: dragula filter 
Javascript :: javascript node await .click 
Javascript :: event handler attachment jquery 
Javascript :: how to use getBackgroundPage 
Javascript :: react redux cheat sheet 
Javascript :: deconstruction javascript check if exist attrib 
Javascript :: Enzymes are proteins that speed up reactions by 
Javascript :: angular.json to war 
Javascript :: grel general expression character classes 
Javascript :: how to query in windows js 
Javascript :: how to show 2 point destination on google map js code stack overflow 
Javascript :: chunks bug vue js 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =