BeautifulSoup - extracting attribute values

If you already have the anchor, grab the href attribute like this:

href = anchor["href"]

link.get('href')

in which 'link' is the name of your 'a' tag