img class="profile-icon-img" alt="" src="https://yt3.ggpht.com/a-/AOh14GhRwaNt-hoxQA1CoiFIXi0f9IalxGKtF8osCw=s68-c-k-c0x00ffffff-no-rj-mo"
我的使用方式:
String strImg = eContent.get(nIndex).select("img.profile-icon-img").attr("src");
最佳答案
试试这个:
Element imageElement = document.select("img").first();
String absoluteUrl = imageElement.absUrl("src"); //absolute URL on src
String srcValue = imageElement.attr("src"); // exact content value of the attribute.
更多信息请点击:http://jsoup.org/cookbook/extracting-data/working-with-urls
关于java - 如何使用 jsoup 获取 img src?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60503065/