我正试图用Python中的靓汤从雅虎财经(Yahoo Finance)刮去道琼斯股票指数。在
以下是我尝试过的:
from bs4 import BeautifulSoup
myurl = "http://finance.yahoo.com/q/cp?s=^DJI"
soup = BeautifulSoup(html)
for item in soup:
date = row.find('span', 'time_rtq_ticker').text.strip()
print date
以下是谷歌chrome的元素检查:
我怎么能从span标签上刮出17555.47的数字?在
只需使用
find
,非常简单,如下所示:相关问题 更多 >
编程相关推荐