Skip to content

Instantly share code, notes, and snippets.

@itdaniher
Created June 2, 2012 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itdaniher/2856235 to your computer and use it in GitHub Desktop.
Save itdaniher/2856235 to your computer and use it in GitHub Desktop.
scrape atomic weight information from IUPAC
import urllib
from bs4 import BeautifulSoup
soup = BeautifulSoup(urllib.urlopen("http://www.chem.qmul.ac.uk/iupac/AtWt/index.html").read())
t = soup.findAll("table")[2]
print [ [item.text for item in row.findAll("td")] for row in t.findAll("tr") ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment