I have a webpage that contains many links. I want to trigger click event for all of them automatically and sequentially(one by one).I do not know how to make this happen with puppeteer.Could anybody give me some advice? Thank you!
答案 0 :(得分:0)
尝试这样的事情:
const selector = 'a.someclass';
const elements = await page.$$(selector);
for (let i = 0; i < elements.length; i++) {
const element = elements[i];
await element.click();
}
&#13;