forked from kokonior/Javascript-Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPopCatClicker.js
More file actions
23 lines (22 loc) · 755 Bytes
/
PopCatClicker.js
File metadata and controls
23 lines (22 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const puppeteer = require("puppeteer-extra");
const StealthPlugin = require("puppeteer-extra-plugin-stealth");
puppeteer.use(StealthPlugin());
const log = require("single-line-log2").stdout;
const klik = async (page) => {
await page.click("#app > div");
await page.click("#app > div");
};
(async () => {
const browser = await puppeteer.launch({
headless: true,
devtools: false,
});
const popCatPage = await browser.newPage();
await popCatPage.goto("https://popcat.click/", { waitUntil: "networkidle2" });
while (true) {
await klik(popCatPage);
let counter = await popCatPage.$("#app > div > div[class*=counter]");
let count = await counter.evaluate((el) => el.textContent);
log("Clicked times : ", count);
}
})();