Is there any way or Puppeteer API we can wait element to disappear or remove from Dom and then continue the execution?
E.g I have a loading animation I want to wait until this loading animation remove from Dom.
waitForSelector
has a hidden
option which also check if the element is in the DOM:
await page.waitForSelector('div', {hidden: true});
Try this
await page.waitFor(() => !document.querySelector(querySelector));
or even the waitForFunction()
await page.waitForFunction()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With