更新时间:2023-02-23 16:32:08
您需要 元素#absUrl()
。
String url = dl.select("a").absUrl("href");
您可以顺便缩短选择范围:
You can by the way shorten the select:
Document document = Jsoup.connect(url).get();
Elements links = document.select("div.results dl a");
for (Element link : links) {
String url = link.absUrl("href");
}