【发布时间】:2020-07-21 20:55:18
【问题描述】:
我正在尝试从两个表中检索数据,这些表的数据每0.5 秒更新一次,该表存在于嵌套类结构中。我使用了 Selenium 的driver.find_element_by_xpath 并试图通过div[contains(@class,one)]/div[contains(@class,two)]... 的序列获取数据,但徒劳无功。
我尝试了它的其他可用方法并搜索了其他资源,但无法接近。
任何线索!这是 HTML 代码:
<body>
<div class="one">
<div class="two">
<div class="three">
<!--- First table -->
<table class="Jan">
<thread>...</thread>
<tbody>
<tr>
<td class='cost'>100 </td>
</tr>
<tr>
<td class='cost'>86 </td>
</tr>
.
.
.
<tr>
<td class='cost'>56 </td>
</tr>
</tbody>
<tfoot>...</tfoot>
</table>
<!--- Second table -->
<table class="Feb">
<thread>...</thread>
<tbody>
<tr>
<td class='cost'>-856 </td>
</tr>
<tr>
<td class='cost'>-8986 </td>
</tr>
.
.
.
<tr>
<td class='cost'>-9856 </td>
</tr>
</tbody>
<tfoot>...</tfoot>
</table>
</div>
</div>
</div>
【问题讨论】:
标签: python html selenium css-selectors