Issue
I'm trying to get the specific link from this
<a href="/doi/10.1021/ed500712k" title="Next" class="header_contnav-next">
<i class="icon-angle-right"></i>
</a>
I'm only able to find all the links within the page and it would be helpful to extract this specific one.
Thank you !
Solution
I presume you're using .find_all() function to get links, to find a specific item, you should use .find() function instead of that. If you're sure that only this one has the "class" variable set to "header_contnav-next", then all you need to do is to specify it in dictionary format:
soup.find("a", {"class": "header_contnav-next"})['href']
Answered By - Rasoul Ghasemi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.