Eng*_*uad 1 html java regex xml htmlunit
我正在尝试在标签之间获取文本<dev>Text Here</dev>:
<div id="tt" class="info">
Text Here
</div>
Run Code Online (Sandbox Code Playgroud)
Output: Text Here
Run Code Online (Sandbox Code Playgroud)
如何在java中使用正则表达式来实现这一点?谢谢.
编辑:
我正在使用HtmlUnit:
currentPage.getElementById("tt").asXml();
Run Code Online (Sandbox Code Playgroud)
currentPage.getElementById("tt").asText(); // returns ""
Run Code Online (Sandbox Code Playgroud)