Closed shstkvch closed 1 year ago
We don't have custom selectors yet. It's something we've talked about. I often use the $xpathSelector DOM extension for something similar: https://ulixee.org/docs/hero/basic-client/awaited-dom-extensions#xpathSelector
That's useful, thank you Blake. I suppose I could just wrap that in a little locate()
utility function to make it a bit more usable for me.
Hello, me again. I'm used to using this method in playwright to find an element by its text content:
await page.locator('text=Log in').click();
Is there an equivalent method in Hero? This would be a very useful feature
I'm aware I can find the element like this, but it feels a bit clunky:
document.evaluate('//a[contains(., "Log in")]', document).iterateNext()