java - Jsoup is not finding my element -
perhaps i'm doing wrong, i'm trying parse page using jsoup, reason doesn't find me div i'm looking for
doc = jsoup.connect(params[0]).get(); content = doc.select("div.itemcontent").first().text();
where going wrong here? thanks
the problem: different website using jsoup using browser. set useragent in jsoup, no luck. possible content changed through javascript?!
however, can change selector according webseite get. it's idea take document it's parsed - simple system.out.println(doc)
enough.
here steps can try:
- print document
doc
(eg. usingsystem.out
) - search required value(s) in there
- select tags instead
i played around bit, maybe can use snipped:
content = doc.select("description").first().text();
it seems me, <description>...</description>
you're looking for.
Comments
Post a Comment