java - How to get text from specific href with jsoup? -
i text http://m.wol.jw.org/en/wol/dt/r1/lp-e/2014/6/26 via jsoup in android app. looks like:
public static void refreshfromnetwork(context context) { document document; elements dateelement; elements textelement; elements commentelement; try { calendar calendar = calendar.getinstance(); int year = calendar.get(calendar.year); int month = calendar.get(calendar.month) + 1; int day = calendar.get(calendar.day_of_month); sdayurl = surl + "/" + year + "/" + month + "/" + day; document = jsoup.connect(sdayurl).get(); if (document.hastext()) { dateelement = document.select(".ss"); textelement = document.select(".sa"); commentelement = document.select(".sb"); sdate = dateelement.text(); stext = textelement.text(); scomment = commentelement.html(); ssavedforcheckingdate = slocaldate; saveprefs(context); sdayurl = null; } else { toast.maketext(mcontext, mcontext.getstring(r.string.warning_unstable_connection), toast.length_short).show(); } } catch (ioexception e) { system.out.println("error"); e.printstacktrace(); } }
but there hrefs in text. when cursor on them, pops text frame. can't post images, see there: http://habrastorage.org/files/45e/b09/17f/45eb0917f3644bbd9e5ea2b79d98363d.png
but when try text href (i scomment html), returns me text (which displays when click on href), not part of it, in popup. i'm not web developer, don't understand, how desired text. how can it?
follow snapshot below text on pop-up
see text popup text on page also, extract text shown on popup use class , display contents
when click on link href, new page open same text red font text need pop-up text, have use
string href=scomment.attr("href"); document doc=jsoup.connect(href).get(); element element= doc.getelementbyid("p101"); string dialogtext=element.text();
this solution question. hope it'll you
Comments
Post a Comment