Sindu_
Sindu_

Reputation: 1465

Getting text inside a div class in jsoup

I am trying to extract all the text inside the div class "row result". There are many with the same div class name, but different id's. I want to extract all of the text which has the div class as row result. Here is the website link : http://www.indeed.co.uk/jobs?q=fashion&l=England

<div class="  row  result" id="p_8f8039e2c2636a2a" data-jk="8f8039e2c2636a2a" itemscope="" itemtype="http://schema.org/JobPosting" data-tn-component="organicJob">

But nothing gets displayed when I run the following code. Please help.

doc = Jsoup.connect("http://www.indeed.co.uk/jobs?q=fashion&l=England").timeout(5000).get();    
Elements e = doc.select(".row  result");
System.out.println("Details: "+ e.text());

Upvotes: 0

Views: 528

Answers (1)

Shirin Safaeian
Shirin Safaeian

Reputation: 960

I think you must write your code like this:

Elements e = doc.select(".row.result");

Upvotes: 1

Related Questions