我正在使用scrapy从一个表中的网站抓取内容。在
代码示例:
<tr>
<td><div>2018/2058</div></td>
<td class="address"><div>Land North of 37 and 39 Hare Lane Claygate Esher Surrey KT10 9BT</div></td>
<td class="proposal"><div>Confirmation of Compliance with Conditions: 5 (Tree Protection and Pre-Commencement Inspection) and 6 (Tree Protection) of planning permission 2017/0451.</div></td>
<td><div style="min-width:90px">Claygate Ward</div></td>
</tr>
但是,正如您可以看到的那样,文本位于每个“tr”标记的div中,如何使用xpath或css选择器获取文本?在
我试过了
^{pr2}$以下是网站:
提前谢谢!在
使用gangabass中的xpath:
只从td中删除了[1]以获取所有行。在
你可以很容易地使用熊猫。在
现在表是一个包含完整表的数据帧
更新
^{pr2}$相关问题 更多 >
编程相关推荐