【发布时间】:2020-07-18 00:13:23
【问题描述】:
我想使用 Requests-HTML 仅从父标签中提取文本。 如果我们有这样的html
<td>
<a href="">There</a> <a href="">are</a> <a href="">some</a> <a href="">links.</a> The text that we are looking for.
<td>
然后
html.find('td', first=True).text
结果
>>> There are some links. The text that we are looking for.
【问题讨论】:
-
你好格鲁克。我会研究漂亮的汤。
标签: python-3.x html-parsing python-requests-html