我“米试图用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