2
開始我想刪除的鏈接href屬性與http://goo.gl到https://goo.gl開始。Jsoup刪除鏈接href屬性與HREF
下面是我的代碼,但它是不完全的錯誤消息。
我不知道該怎麼辦。請幫幫我。
public class NewClass {
public static void main(String[] args) {
try {
Document connect = Jsoup.connect("http://blogtamsu.vn/ngoc-trinh-duoc-goi-la-hinh-mau-bao-hieu-tot-doi-dep-dao.html").get();
Elements selects = connect.select("div.remain_detail");
String levels = "a[href^=http://goo.gl],a[href^=https://goo.gl]";
for (String level : levels.split(",")) {
selects.remove(level);
}
System.out.println(Jsoup.clean(selects.html(), Whitelist.relaxed()));
} catch (IOException ex) {
Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
我感覺好極了我的命令是由您的answer.Thank成功執行你了 –