HTML抽取器 Xsoup

码农软件 · 软件分类 · HTML解析器 · 2019-04-02 21:11:50

软件介绍

Xsoup是基于Jsoup开发的HTML抽取器,提供了XPath支持。

相比另一个常用的基于XPath的HTML抽取器HtmlCleaner,Xsoup有较大的性能优势,解析时间和抽取时间都只有HtmlCleaner的一半。同时Xsoup提供全面的XPath解析错误提示。

示例代码:

@Test
public void testSelect() {
	String html = "<html><div><a href='https://github.com'>github.com</a></div></html>";

	Document document = Jsoup.parse(html);

	String result = Xsoup.select(document, "//a/@href").get();
	Assert.assertEquals("https://github.com", result);

	result = Xsoup.compile("//a/@href").evaluate(document).get();
	Assert.assertEquals("https://github.com", result);
}

本文地址:https://codercto.com/soft/d/2728.html

Twenty Lectures on Algorithmic Game Theory

Twenty Lectures on Algorithmic Game Theory

Tim Roughgarden / Cambridge University Press / 2016-8-31 / USD 34.99

Computer science and economics have engaged in a lively interaction over the past fifteen years, resulting in the new field of algorithmic game theory. Many problems that are central to modern compute......一起来看看 《Twenty Lectures on Algorithmic Game Theory》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具