I'm using Puppeteer 22.6.0 with NodeJS for web scraping, I'm trying to pause the script until a specific h1 element is visible, the issue is there are multiple h1 elements on the page and the only possible way to identify that certain h1 is with checking if it says a certain message, like: <h1>something</h1>
Since I can't do this using a selector (as far as I know), I tried using page.waitForXPath() but I get the error:
TypeError: page.waitForXPath is not a function
I have searched for a solution but it seems the method has been removed, is there any workaround for this? Thanks.