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://www.codercto.com/soft/d/2728.html

Single Page Web Applications

Single Page Web Applications

Michael Mikowski、Josh Powell / Manning Publications / 2013-9-30 / USD 44.99

Code for most web sites mostly runs on the server. When a user clicks on a link, the site reacts slowly because the browser sends information to the server and the server sends it back again before di......一起来看看 《Single Page Web Applications》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具