python BeautifulSoup parsing table
Here you go: data = [] table = soup.find(‘table’, attrs={‘class’:’lineItemsTable’}) table_body = table.find(‘tbody’) rows = table_body.find_all(‘tr’) for row in rows: cols = row.find_all(‘td’) cols = [ele.text.strip() for ele in cols] data.append([ele for ele in cols if ele]) # Get rid of empty values This gives you: [ [u’1359711259′, u’SRF’, u’08/05/2013′, u’5310 4 AVE’, u’K’, u’19’, … Read more