public static String getProblemSummary() {
String result = "";
Node node = getDomNode("span", "问题摘要");
HTMLTextAreaElement textarea= (HTMLTextAreaElement) node.getParentNode().getNextSibling().getFirstChild().getFirstChild().getFirstChild();
result=textarea.getValue();
return result;
}
pr
ivate static Node getDomNode(String tagname, String content) {
Document doc = webView.getEngine().getDocument();
NodeList inputNodeList = doc.getElementsByTagName(tagname);
Node node = null;
for (int i = 0; i < inputNodeList.getLength(); i++) {
if (content.equals(inputNodeList.item(i).getTextContent().replaceAll(" ",""))) {
node = inputNodeList.item(i);
System.out.println("找到节点:"+content);
break;
}
}
return node;
}
01-15
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交