const puppeteer = require("puppeteer");
(async () => {
try {
const browser = await puppeteer.launch({ headless: true});
const page = await browser.newPage();
await page.goto('url/c-0');
await page.waitForSelector('.box-chap');
const element = await page.$(".box-chap");
const content = await page.evaluate(element => element.textContent, element);
console.log(content + "chapter");
} catch (error) {
}
})();
Привет всем, в настоящее время я хочу зациклить:
URL / с-0'
URL / с-1'
URL / с-2'
.....
Пожалуйста, дайте мне решения, спасибо всем.