You can grab the td
elements with this code:
webpage = urlopen(req).read()
soup = bs(webpage, "lxml")
table=soup.find('table', {'class': 'table'}).find('tr')
rows=list()
for row in table.findAll("td"):
rows.append(row)
I prefered using lxml
as the parser because it has some advantages, but you can keep using html.parser
You can also use pandas
, It will create, It's so much easier to learn from its documentaion (there is a lot).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…