我「米試圖用selenium
在python
檢索詞‘年度報告’和‘首次公開發行招股說明書’。蟒蛇硒打印「日」
我嘗試使用driver.find_elements_by_class_name('sic_highlight')
但因爲有多個表是具有相同class_name
,它從其他表打印一切爲好。
如何我剛打印出的「年度報告」和「IPO募資」的文字,而無需通過其他表搜索?
<table class="sic_table" cellspacing="1">
<thead>
<tr class="sic_tableTopRow">
<th scope="col">Report Type</th>
<th scope="col">Year Ended</th>
<th scope="col">Download</th>
</tr>
</thead>
<tbody>
<tr class="sic_highlight">
<th colspan="3" scope="col" class="sic_highlight">Annual Report</th>
</tr>
<tr>
<th class="si_left">Annual Report 2016</th>
<td class="si_center">Jun 2016</td>
<td class="si_center">
<a href="some_link">Part 1(1.41 MB)</a><br>
</td>
....
....
</tr>
<tr class="sic_highlight">
<th colspan="3" scope="col" class="sic_highlight">IPO Prospectus</th>
</tr>
<tr>
<th class="si_left">IPO Prospectus 2011</th>
<td class="si_center">Jul 2011</td>
<td class="si_center">
<a href="some_link">Part 1(5.10 MB)</a><br>
</td>
</tr>
</tbody>
</table>
如果沒有看到其他表*,很難給出一個很好的答案。你能分享一個嗎? – Andersson