In prior versions of Puppeteer, we could query elements using an XPath like so
const xpath = `//TD[contains(text(),"sometext")]/following-sibling::td`;
const elements = await page.$x(xpath);
These functions have been removed, and the guidance is to
const xpath = `//TD[contains(text(),"sometext")]/following-sibling::td`;
const elements = await page.waitForSelector(`xpath/${xpath}`);
But this has different behaviour. It waits (which we don’t want) and returns 1 element (we used to get arrays).
Is there any way to use XPath queries the way we used to in the Puppeteer v22.10?