【发布时间】:2014-07-17 20:12:56
【问题描述】:
我是 html 解析和尝试获取的新手
document = Jsoup.connect("http://www.beyazperde.com/filmler/tum-filmleri/kullanici-puani/tur-13015/"+"?page=" + i).get();
Elements links = document.select("div.content a.no_underline");
for (Element link : links)
{
Element url = link.after("filmler/film-");
System.out.println(url);
}
当我跑步时,我得到了这些
<a class="no_underline" title="" href="/filmler/film-10080/"> Cesuryürek </a>
<a class="no_underline" title="" href="/filmler/film-9393/"> Schindler’in Listesi </a>
<a class="no_underline" title="" href="/filmler/film-28359/"> Piyanist </a>
但我想要"10080","9393","28359" 只是这些数字而不是整个<a> 标签。有没有办法做到这一点?
【问题讨论】: