forked from 14790897/auto-read-liunxdo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_linuxdo.js
32 lines (31 loc) · 872 Bytes
/
test_linuxdo.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
31
32
import { connect } from "puppeteer-real-browser";
while (true) {
console.log("Start of test.js");
const { page, browser } = await connect({
headless: 'auto',
args: [],
customConfig: {},
skipTarget: [],
fingerprint: false,
turnstile: true,
connectOption: {},
});
var cl = setInterval(() => {
page
.screenshot({ path: "example.png", fullPage: true })
.catch((e) => console.log(e.message));
}, 1000);
console.log("Connected to browser");
// https://nopecha.com/demo/cloudflare https://linux.do
await page.goto("https://linux.do", {
waitUntil: "domcontentloaded",
});
console.log("Navigated to page");
await page.waitForSelector(".link_row", {
timeout: 60000,
});
// await page.screenshot({ path: 'example.png' });
clearInterval(cl);
await browser.close();
console.log("End of test.js");
}