BeautifulSoup getting href

I have the following soup:

<a href="some_url">next</a>
<span class="class">...</span>

From this I want to extract the href, "some_url"

I can do it if I only have one tag, but here there are two tags. I can also get the text 'next' but that’s not what I want.

Also, is there a good description of the API somewhere with examples. I’m using the standard documentation, but I’m looking for something a little more organized.

Leave a Comment