Java 使用jericho html解析器分析页面中的指定文本
从页面检索指定文本时出现问题。我使用的例子是 如果你去这个网站,你会看到一个“总数:82”(这是criterium SASA的点击数)。我需要这个号码。我使用jericho html解析器,但我找不到任何函数来实现这一点 有人能帮我吗?我真的需要把这个号码写在页面上 提前谢谢 -Sasa如果您可以切换到: 完成了 输出: 总数:83 (网站上的值已更改) 选择者解释说:Java 使用jericho html解析器分析页面中的指定文本,java,html-parsing,jericho-html-parser,Java,Html Parsing,Jericho Html Parser,从页面检索指定文本时出现问题。我使用的例子是 如果你去这个网站,你会看到一个“总数:82”(这是criterium SASA的点击数)。我需要这个号码。我使用jericho html解析器,但我找不到任何函数来实现这一点 有人能帮我吗?我真的需要把这个号码写在页面上 提前谢谢 -Sasa如果您可以切换到: 完成了 输出: 总数:83 (网站上的值已更改) 选择者解释说: doc.select("p.t2") // Select each 'p'-tag with 't2' attribute f
doc.select("p.t2") // Select each 'p'-tag with 't2' attribute from document
.first() // Get the first one (there are two on the website, but the first one is the required one)
.text() // Get the text of this element
文档:
doc.select("p.t2") // Select each 'p'-tag with 't2' attribute from document
.first() // Get the first one (there are two on the website, but the first one is the required one)
.text() // Get the text of this element