2
我想从下面的链接下载所有年份(年度趋势下)的EPS值。 http://www.bseindia.com/stock-share-price/stockreach_financials.aspx?scripcode=500180&expandable=0从网址中提取表格中的一行
我试过用下面的答案中提到的美丽汤。 Extracting table contents from html with python and BeautifulSoup 但在下面的代码后无法继续。我觉得我非常接近我的答案。任何帮助将不胜感激。
from bs4 import BeautifulSoup
import urllib2
html = urllib2.urlopen("http://www.bseindia.com/stock-share-price/stockreach_financials.aspx?scripcode=500180&expandable=0").read()
soup=BeautifulSoup(html)
table = soup.find('table',{'id' :'acr'})
#the below code wasn't working as I expected it to be
tr = table.find('tr', text='EPS')
我愿意用任何其他语言来完成这件事
你得到什么结果,你没有想到? –
对象tr是空的 – user1638998