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:

  1. print document doc (eg. using system.out)
  2. search required value(s) in there
  3. 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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -