-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod.js
30 lines (26 loc) · 956 Bytes
/
mod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var lin = process.env.USER_ID;
const puppeteer = require('puppeteer');
const execFile = require('child_process').execFile;
function launchHeadlessChrome(url, callback) {
// Assuming MacOSx.
const CHROME = '/usr/bin/google-chrome-stable';
execFile(CHROME, ['--headless', '--disable-gpu', '--remote-debugging-port=9222', "CONNECTION_TIMEOUT=60000","-incognito",url], callback);
}
launchHeadlessChrome('', (err, stdout, stderr)=>{});
const f = (async() => {
const browser = await puppeteer.launch({
dumpio: true,
headless: false
});
const page = await browser.newPage();
await page.goto(lin);
await setTimeout(async() =>{
const link = await page.evaluate(() => document.querySelector('*').outerHTML);
await page.mouse.click(782, 354);
await setTimeout(async() =>{
await page.bringToFront();
await page.mouse.click(782, 354);
}, 10);
}, 10000);
});
f();