You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 theattr
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.The text was updated successfully, but these errors were encountered: