-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
37 lines (32 loc) · 1.25 KB
/
index.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
33
34
35
36
37
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({headless: false, devtools: true});
const page = await browser.newPage();
debugger;
for(let i=0; i<30; i++){
await page.goto('https://www.telewebion.com/program/all-episodes/64988', {timeout: 500000});
await page.evaluate((i) => {
debugger;
let elements = document.getElementsByClassName('image-frame');
elements[i].click()
}, i);
await page.reload({ waitUntil: ["networkidle0", "domcontentloaded"] });
await page.evaluate(() => {
let download = document.getElementsByClassName('fa-cloud-download');
console.log(download)
download[0].click()
let modal = document.getElementsByClassName('h-100 w-100 border-0 pointer')
console.log(modal)
// debugger
modal[2].click()
});
await page.waitFor(600000)
}
// await page.waitForSelector('identifierId')
// // await page.reload({ waitUntil: ["networkidle0", "domcontentloaded"] });
// await page.$eval('#identifierId', el => el.value = '[email protected]');
// await page.keyboard.press('Enter')
// await page.evaluate(() => {
// // document.querySelector('#identifierId').value = 'bahrami.ehssan';
// });
})();