1

I ran into a few questions on StackOverflow that asked about parsing html with xpath using Java.

This is the best answer I found so far here.

But it looks like DomSerializer is no longer available in Java 11.

How can I use DomSerializer in Java 11 ?

4

1 回答 1

2

将以下依赖项添加到pom.xml

<dependency>
    <groupId>net.sourceforge.htmlcleaner</groupId>
    <artifactId>htmlcleaner</artifactId>
    <version>2.6.1</version>
</dependency>

或者

你可以htmlcleaner-2.6.1.jar这里下载。

那个罐子(或工件)DomSerializer里面有这个类。

链接阅读文档:http://htmlcleaner.sourceforge.net/doc/org/htmlcleaner/DomSerializer.html

于 2019-07-07T17:39:28.500 回答