2014-02-20 78 views
0

好吧,我想要實現的是寫入每個結果JSoup在單獨的String中提取我。這是否有可能?我可以得到第一個和最後一個功能,但是,然後,其餘的都失去了。JSoup Android:在單獨的字符串中獲取每個結果

現在我有這個在我的doInBackground:

// Connect to the web site 
        Document document = Jsoup.connect(url).get(); 
        // Using Elements to get the Meta data 
        Elements titleElement = document.select("h2[property=schema:name]"); 
        // Locate the content attribute 
        date1 = titleElement.toString(); 

        Log.e("Date", String.valueOf(Html.fromHtml(date1))); 

有了這個,我得到一個結果列表,這是很好的,但我希望有每個結果在一個單獨的字符串。

由於提前,如果你需要什麼更多請諮詢:)

回答

0

我通過文件仔細閱讀一遍又發現這一點:

element.eq(n).text 

的「n」的定義要獲取的位置, .text去除所有html並使其成爲可讀文本

相關問題