If you already have the anchor, grab the href
attribute like this:
href = anchor["href"]
More Related Contents:
- Extracting an attribute value with beautifulsoup
- How to find elements by class
- How to remove \xa0 from string in Python?
- BeautifulSoup getting href [duplicate]
- Scraping: SSL: CERTIFICATE_VERIFY_FAILED error for http://en.wikipedia.org
- Using BeautifulSoup to extract text without tags
- Difference between .string and .text BeautifulSoup
- Beautiful Soup findAll doesn’t find them all
- BeautifulSoup – search by text inside a tag
- BeautifulSoup findAll() given multiple classes?
- Python BeautifulSoup extract text between element
- How can I get href links from HTML using Python?
- Python/BeautifulSoup – how to remove all tags from an element?
- How to find tags with only certain attributes – BeautifulSoup
- Using BeautifulSoup to search HTML for string
- Beautiful Soup Can’t Find Tags
- Understand the Find() function in Beautiful Soup
- Extract content of with BeautifulSoup
- python beautifulsoup iframe document html extract
- How to use CSS selectors to retrieve specific links lying in some class using BeautifulSoup?
- How to change tag name with BeautifulSoup?
- Can bs4 get the dynamic content of a webpage if requests can’t?
- Is there an InnerText equivalent in BeautifulSoup?
- What causes `None` results from BeautifulSoup functions? How can I avoid “AttributeError: ‘NoneType’ object has no attribute…” with BeautifulSoup?
- BeautifulSoup: Get the contents of a specific table
- Scrape the absolute URL instead of a relative path in python
- Get document DOCTYPE with BeautifulSoup
- beautiful soup just get the value inside the tag
- Missing parts on Beautiful Soup results
- Python BeautifulSoup give multiple tags to findAll