Reputation: 408
Is there any way to get a the link out of an a
element that's nested within a div
element when all I can match is the div
element? Something similar to the get_text()
method but for links.
Here is what i have matched:
<div class="headline"><a href="http://www.davar1.co.il/116053/">כל שעה שווה לכם קצת יותר</a>
this is my bs4 call:
>>> headlines = davarsoup.select('.headline')
Upvotes: 0
Views: 45
Reputation: 408
I figured it out! i thought i had tried this solution already, but apparently there was a typo. here is how i solved it:
>>> headlines = davarsoup.select('.headline > a')
sorry to bother anyone who might have bothered.
Upvotes: 1