Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "select through function" #105

Open
lucafabbian opened this issue Nov 5, 2024 · 1 comment
Open

Add "select through function" #105

lucafabbian opened this issue Nov 5, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@lucafabbian
Copy link

lucafabbian commented Nov 5, 2024

I would like to retrieve an element based on a custom expression rather than a css selector.
Something like:

const xLink = await page.$( () => document.querySelectorAll('div').filter( el => el.innerText = 'Hello world!'))

await xLink.click()

Is there already a way to do that? This would be extremely useful given that many pages do not have clear ids.

@lino-levan lino-levan added the enhancement New feature or request label Nov 5, 2024
@lino-levan
Copy link
Owner

This is something I've been meaning to do. Would definitely be super nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants