Element (<input id="pagenum-input" class="form-control" aria-label="..." value="1" min="1" max="28">)
Я хочу использовать значение max (28) в качестве значения максимальной переменной, которую я создал во 2-м цикле. Как я могу получить значение max из входного тега в моей программе?
Любая помощь будет оценена. Спасибо!
const puppeteer = require('puppeteer');
async function getPic() {
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
for (let j=2; j<=6; j++) {
await page.setViewport({width: 2000, height: 2500})
await page.goto('http://epaper.freepressjournal.in/');
await page.click('body > div > div.common_section > div > div > div.rw_rightcrousel > div > div:nth-child('+j+') > a > div > img');
await page.waitFor(2000);
await page.click('#left-chunk-1 > img');
var maximum;
for (let i= 1; i<=maximum; i++) {
await page.waitFor(2000);
await page.screenshot({path: '//192.168.2.19/em/automatic downloading/Puppeteer/freepressjournal/'+j+''+i+'.png'});
await page.waitFor(2000);
await page.click('#page-div > a.right_arrow_pgright.btn_next');
}
}
await browser.close();
}
getPic();
// This loop will automatically get the value of max that is 28.
// The value of max will vary according to pages. The program should accept
// the value of max in maximum and run the loop accordingly.
for (let i= 1; i<=maximum; i++)