public class cs {
public static void main(String[] args) throws IOException {
Document doc= Jsoup.connect("https://www.txt99.org/18045/5103299.html").get();
Elements i003 = doc.getElementsByAttributeValue("id","next_url"); //通过对应的key和值寻找
String aLink= i003.select("a").first().attr("abs:href"); //获取a标签下面的链接
System.out.println(aLink);
}
}
文字就这么多了,简单但是有效要爬小说对应的下一页标签用这个
对应的
doc.getElementsByAttributeValue("id","next_url");
方法里面id和对应的值设置一下就可以爬取了