【发布时间】:2021-12-23 00:31:44
【问题描述】:
如何使用beautifulsoup 从示例 HTML 中提取数据?
<Tag1>
<message code="able to extract text from here"/>
<text value="able to extract text that is here"/>
<htmlText><![CDATA[<p>some thing <lite>OR</lite>get exact data from here</p>]]></htmlText>
</Tag1>
我尝试了.findall 和.get_text,但是我无法从htmlText 元素中提取文本值。
预期输出:
some thing ORget exact data from here
【问题讨论】:
标签: python html python-3.x beautifulsoup