i have a little problem with puppeteer, i don’t know how to loop my event when the page refreshing. It work 1 time after i need to restart Chromium.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({headless: false});
const rapidGiveway = await browser.newPage();
rapidGiveway.once('load', async () => {
console.log("Page loaded!")
const participate = await rapidGiveway.$x("//button[@id='giveaway-enter']");
await rapidGiveway.waitForXPath("//button[@id='giveaway-enter']", {visible: true})
await participate[0].click();
});
})();