我有以下html,使用Jsoup我试图提取p部分中没有任何属性的文本(文本"Some text 2"而不是"Some text 1").
<div id="intro">
<h1 class="some class">
<p id="some_id">
Some text 1
</p>
<p>
Some text 2
</p>
</div>
Run Code Online (Sandbox Code Playgroud)
我尝试使用以下Jsoup表达式:
div[id=intro] > p:not(:has(@*))
Run Code Online (Sandbox Code Playgroud)
但它不起作用.谢谢你的帮助.