import urllib.request from bs4 import BeautifulSoup inputpage = urllib.request.urlopen("http://gnats.netbsd.org/summary/year/2012-perf.html") page = inputpage.read() soup = BeautifulSoup(page) names = [] cdict = {0:[], 1:[]} # dictionary of "td positions to contents" tables = soup.findAll('table') for tt in tables[1].find_all('tr')[1:]: # skip first since it is the header names.append(tt.find_all('th')[0]) # 1st column is a th with the name for k, v in cdict.items(): # append the text of column k to the corresponding list v.append(tt.find_all('td')[k].text) for i in range(len(names)): print (names[i], int(cdict[0][i]) + int(cdict[1][i]))