我试图抓取网站:
http://finance.sina.com.cn/futures/quotes/I0.shtml?from=wap
为了捕捉中国铁矿石的变化:
抓取后,我搜索标签并找到所有空的' -- '
我正在使用:
url2 = 'http://finance.sina.com.cn/futures/quotes/I0.shtml?from=wap'
html2 = urlopen(url2)
bs2 = BeautifulSoup(html2, 'lxml')
print(bs2.title)
print(bs2.find_all('span', class_ = 'amt'))
输出:
<title>铁矿石2005(I0)期货行情,新闻,报价_新浪财经_新浪网</title>
[<span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>, <span class="amt">--</span>,.....
我已经打开了浏览器控制台,找出网站正在调用的其他页面,并找到了这两个:
http://hq.sinajs.cn/?_=1584562106303/&list=sz002578,sz002082,sz002167,sz002501,sh600432,sh600255,sz002160,sz002379,sz002428,sh600311,nf_RB2005,nf_I2005,nf_P2005,nf_M2009,nf_Y2005,nf_JD2005,nf_FU2005,nf_BU2006,hf_CAD,hf_CL,hf_GC,hf_SI,hf_S,hf_BO,hf_C,hf_W,hf_AHD,hf_OIL,nf_I0,nf_I2005
http://hq.sinajs.cn/?_=1584562106303/&list=nf_I0
但没有什么可以找到资产的变化.....(+ 0.16%)
你能帮我解决这个问题吗?
慕婉清6462132
蝴蝶不菲
相关分类