【发布时间】:2019-06-25 15:07:24
【问题描述】:
这是使用 Scrapy。
我遇到了以下类型的标记:
<p>Noting the presence of a footnote<sup>1</sup> is one common way for superscripts to be used.</p>
测试页面:
https://html.com/tags/sup/
测试查询:
response.css('div.render p::text')[0].extract()
测试项目加载器:
loader.add_css("text", "div.render p::text")
测试结果:
注意脚注的存在
预期测试:
注意脚注的存在是使用上标的一种常见方式。
问题:
如何获取段落的全文,忽略子标签?
【问题讨论】: