Skip to content

match tag contents #6

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

Open
medecau opened this issue Nov 22, 2023 · 0 comments
Open

match tag contents #6

medecau opened this issue Nov 22, 2023 · 0 comments

Comments

@medecau
Copy link
Owner

medecau commented Nov 22, 2023

we can scrape the text inside of the tag with the text function, but now we need a way to select the tag based on the text content. bs4 already does this. eg: find(string='some text')

i'm not sure how to go about this as the first argument is a css selector.

one option would be to add a text argument to all selector functions but it gets awkward on the attr function. eg: attr(text='next', name='href')

another option would be to parse the selector string and extract text matching patterns. eg attr('a[text="Next"]'). but i'm afraid this will add too much complexity to the code.

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

No branches or pull requests

1 participant