I have a puppeteer script There is a div that has a hidden class This class is deleted after a few minutes and the div becomes visible I can select the div but can't click on it until the hidden class is deleted How do I make it wait until it delete this class from the div ?
Thanks for help
Use .waitForFunction. It repeatedly runs specific function in page context and returns a Promise that resolves when this functions returns a truthly value. Provide it with a function that returns truthly value when your target div doesn't have that class.
Something like:
await page.waitForFunction(() => !document.querySelector('div .hidden_class'))