需要帮助提取HTML META标签使用JSOUP的URL值。这里是我的html -
Need help extracting the URL values from HTML META tag using JSOUP. Here is my html -
String html = "<HTML><HEAD><...></...><META ......><META ......><META http-equiv="refresh" content="1;URL='https://xyz.com/login.html?redirect=www.google.com'"></HEAD></HTML>"
输出预计:https://xyz.com/login.html?redirect=www.google.com
Output expected : "https://xyz.com/login.html?redirect=www.google.com"
谁能告诉我该怎么做。谢谢
Can anyone please tell me how to do that. Thanks
假设,它是第一个 META
String html_src = ...
Document doc = Jsoup.parse(html);
Element eMETA = doc.select("META").first();
String content = eMETA.attr("content");
String urlRedirect = content.split(";")[1];
String url = urlRedirect.split("=")[1].replace("'","");
上一篇:编译的Android NDK启用的Objective-C-gcc的错误错误、oid、Andr、NDK
下一篇:编写/恢复的ObservableCollection&LT; T&GT;ObservableCollection、LT、GT