本人是Python新手,最近想通過Python抓取例如東方財富網上的個股資金歷史流向資料,分別使用了BeautifulSoap和Pyquery.
其中用Pyquery不報錯,但print內容均為空。
其中BeautifulSoap能抓到
<tr>
<th data-field="date" rowspan="2">日期</th>
<th rowspan="2">收盤價</th>
<th rowspan="2">漲跌幅</th>
<th colspan="2">主力凈流入</th>
<th colspan="2">超大單凈流入</th>
<th colspan="2">大單凈流入</th>
<th colspan="2">中單凈流入</th>
<th colspan="2">小單凈流入</th>
</tr>
<tr>
<th data-field="zlje1" data-sortname="zlje1">凈額</th>
<th data-field="zljzb1" data-sortname="zljzb1">凈占比</th>
<th data-field="cddje1" data-sortname="cddje1">凈額</th>
<th data-field="cddjzb1" data-sortname="cddjzb1">凈占比</th>
<th data-field="ddje1" data-sortname="ddje1">凈額</th>
<th data-field="ddjzb1" data-sortname="ddjzb1">凈占比</th>
<th data-field="zdje1" data-sortname="zdje1">凈額</th>
<th data-field="zdjzb1" data-sortname="zdjzb1">凈占比</th>
<th data-field="xdje1" data-sortname="xdje1">凈額</th>
<th data-field="xdjzb1" data-sortname="xdjzb1">凈占比</th>
</tr>
但如何抓取到真實值,還望大俠們指導
先謝謝了
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/261895.html
上一篇:大神,求助
