jsoup xóa phần từ

doc.select("#contentdp").remove();

jsoup lấy attribute

doc.select('meta[property="og:novel:author"]')
doc.select("a").attr("href")

json sang string

console.log(JSON.stringify(obj))

string sang json

let obj = JSON.parse(data)

jsoup lấy phần từ dựa theo text của nó

ví dụ: Lấy href của phần từ có text là 下一页, dùng cho web chia chương to thành chưởng nhỏ chap.js/trang tiếp theo trong gen.js

doc.select("a:contains(下一页)").first().attr("href")
doc.select("person[*=duck]")

Lấy phần tử theo vị trí

.first()
.get(0)
.last()

Ký tự đầu, cuối string

if(url.slice(-1) === "/")
url = url.slice(0, -1)
if(url.slice(-1) !== "/")
url = url + "/";

check substring