-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMyclass.js
More file actions
93 lines (66 loc) · 2.96 KB
/
Myclass.js
File metadata and controls
93 lines (66 loc) · 2.96 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
let minimist = require("minimist");
let fs = require("fs");
const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
const AdblockerPlugin = require('puppeteer-extra-plugin-adblocker');
puppeteer.use(AdblockerPlugin({blockTrackers: true}));
let args = minimist(process.argv);
let configJSON = fs.readFileSync(args.config, "utf-8");
let config = JSON.parse(configJSON);
puppeteer.use(StealthPlugin());
async function run() {
const browser = await puppeteer.launch({
executablePath:
"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
headless: false,
args:[
'--start-maximized',
'--disable-notifications',
'--use-fake-ui-for-media-stream',
],
defaultViewPort: null,
});
let pages = await browser.pages();
let page = pages[0];
await page.goto('https://www.google.com/intl/en-GB/gmail/about/#');
await Promise.all([
page.waitForSelector("a[data-action='sign in']"),
page.click("a[data-action='sign in']")
]);
const email = 'input[type="email"]';
const password = 'input[type="password"]';
await page.waitForSelector(email); //Email Id
await page.type(email, config.userid , { delay: 30 });
await Promise.all([page.keyboard.press('Enter')]);
await page.waitFor(5000);
await page.waitForSelector(password); //password
await page.type(password , config.password , {delay: 20});
await Promise.all([page.keyboard.press('Enter')]);
await page.waitFor(10000);
await page.goto("https://meet.google.com/");
await page.type("input#i3" , config.link , {delay: 20});
await page.click("button[class='VfPpkd-LgbsSe VfPpkd-LgbsSe-OWXEXe-dgl2Hf ksBjEc lKxP2d cjtUbb']");
await page.waitFor(20000);
await page.waitForSelector("div[data-icon-type='1']");
await page.click("div[data-icon-type='1']");
await page.waitFor(1000);
await page.waitForSelector("div[data-icon-type='2']");
await page.click("div[data-icon-type='2']");
await page.waitFor(4000);
await page.waitForSelector("span[class='NPEfkd RveJvd snByac']");
await page.click("span[class='NPEfkd RveJvd snByac']");
await page.waitForSelector("button[aria-label='Chat with everyone']");
await page.click("button[aria-label='Chat with everyone']");
await page.waitFor(3000);
await page.waitForSelector("textarea[jsname='YPqjbf']");
await page.type("textarea[jsname='YPqjbf']" , config.present , {delay:20});
await page.waitFor(2000);
await Promise.all([page.keyboard.press('Enter')]);
await page.waitFor(3000);
await page.waitForSelector("button[class='VfPpkd-Bz112c-LgbsSe yHy1rc eT1oJ IWtuld wBYOYb']");
await page.click("button[class='VfPpkd-Bz112c-LgbsSe yHy1rc eT1oJ IWtuld wBYOYb']");
await page.waitFor(10000);
await page.waitForSelector("button[class='VfPpkd-Bz112c-LgbsSe yHy1rc eT1oJ tWDL4c jh0Tpd Gt6sbf QQrMi NKaD6']");
await page.click("button[class='VfPpkd-Bz112c-LgbsSe yHy1rc eT1oJ tWDL4c jh0Tpd Gt6sbf QQrMi NKaD6']");
}
run();