from BeautifulSoup import BeautifulSoup
import urllib.request, urllib.error, urllib.parse
import re
html_page = urllib.request.urlopen('http://www.yourwebsite.com')
soup = BeautifulSoup(html_page)
for link in soup.findAll('a'):
    pass
How can I get href links from HTML using Python?