如何使用 JSOUP 从 html 字符串中获取图标路径?
我发现在网页上添加图标的不同方式 -
(在谷歌中)
我可以获得的第一种方法是使用 doc.select("html head meta")
但是我不能选择链接标签
最佳答案
获取head元素上的文件名:
Connection con2=Jsoup.connect(url);
Document doc = con2.get();
Element e=doc.head().select("link[href~=.*\\.ico]").first();
String url=e.attr("href");
http://jsoup.org/cookbook/extracting-data/attributes-text-html
关于java - 从 html (JSOUP) 获取图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17596144/