上班无聊,看小说划水必备
@GetMapping ({"/read"})
@ApiOperation("READ")
public Result read(@RequestParam(name = "url",required = true) String url) {
try {
Document document= Jsoup.connect(url).get();
Node nr1 = document.getElementById("nr1");
List<Node> nodes = nr1.childNodes();
for (Node node1 : nodes) {
System.out.println(node1.toString().replace(" ",""));
}
String pb_next = document.getElementById("pb_next").toString();
System.err.println(pb_next);
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
if (i==123){
read("https://*****/******/"+pb_next.split("/")[2]);
}
} catch (Exception e) {
e.printStackTrace();
}
return Result.ok(1);
}