Updated to run in Python 3 with BeautifulSoup4