Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const puppeteer = require('puppeteer');
- const clipboard = require('clipboardy');
- //const delay = require('delay');
- var userClipboard = clipboard.readSync();
- //console.log(clipboard.readSync()); // get clipboard contents
- (async () => {
- const browser = await puppeteer.launch({ headless: false });
- const page = await browser.newPage();
- await page.goto('https://accounts.google.com/signin/v2/identifier?continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&service=mail&sacu=1&rip=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin');
- // enter email username
- await page.type('#identifierId', "xxxxxxxxx@gmail.com");
- await page.type('#identifierId',String.fromCharCode(13));
- await new Promise(resolve => setTimeout(resolve, 1500));
- // enter email password
- await page.type('[autocomplete]', 'xxxxxxxxx', {delay: 100});
- await page.type('[autocomplete]',String.fromCharCode(13));
- await new Promise(resolve => setTimeout(resolve, 5000));
- const emailPage = await browser.newPage();
- await emailPage.goto('https://mail.google.com/mail/u/0/#inbox/xxxxxxxxxxxxxxxxxxxxx');
- //await new Promise(resolve => setTimeout(resolve, 5000));
- await emailPage.waitForNavigation({ waitUntil: 'networkidle2' });
- //await emailPage.click('#\:2r');
- //await emailPage.click('[id=:1w]');
- //await emailPage.click('[jslog]');
- //await emailPage.click('#\:2r');
- await emailPage.$x('/#\:2r');
- const ele = await emailPage.$x('/#\:2r');
- console.log(ele);
- await ele[0].click();
- //await emailPage.$x('/html/body/div[24]/div[1]');
- //const ele = await emailPage.$x('/html/body/div[24]/div[1]');
- //console.log(ele);
- //await ele[0].click();
- //page.mouse.click(x, y)
- //await emailPage.click('span#:5u.ams.bkH');
- console.log(1);
- await new Promise(resolve => setTimeout(resolve, 5000));
- //await page.goto('https://pptr.dev');
- await browser.close();
- console.log("done");
- })();
Add Comment
Please, Sign In to add comment