Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用jericho html解析器分析页面中的指定文本_Java_Html Parsing_Jericho Html Parser - Fatal编程技术网

Java 使用jericho html解析器分析页面中的指定文本

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

从页面检索指定文本时出现问题。我使用的例子是

如果你去这个网站,你会看到一个“总数:82”(这是criterium SASA的点击数)。我需要这个号码。我使用jericho html解析器,但我找不到任何函数来实现这一点

有人能帮我吗?我真的需要把这个号码写在页面上

提前谢谢 -Sasa

如果您可以切换到:

完成了

输出:

总数:83 (网站上的值已更改)

选择者解释说:

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