I checked the requests-html API, and I can't find something to read the child link out of a<a> tag - the only options are links() and absolute_links().
absolute_links() returns a set - so to get the first value, you have to call pop() on it.
So for example, you have:
for row in r.html.find('tr.foo'):
link = row.find('td')[1].absolute_links.pop()
However, I'm curious if I'm doing it the correct way with requests-html - or if there's some inbulit functionality I missed? Or would it make sense to add an easier way to extract links via requests-html?
If I have a table like so:
I checked the requests-html API, and I can't find something to read the child link out of a
<a>
tag - the only options arelinks()
andabsolute_links()
.absolute_links() returns a set - so to get the first value, you have to call pop() on it.
So for example, you have:
However, I'm curious if I'm doing it the correct way with requests-html - or if there's some inbulit functionality I missed? Or would it make sense to add an easier way to extract links via requests-html?