exponentialFun
exponentialFun

Reputation: 225

Jsoup given image scraping

enter image description here

I want to get all those green underlined information using jsoup. And as selecter I want to use that red underlined div class hoverDiv The code I am using is somewhat like below:

doc = Jsoup.connect("http://www.mo").get();

links = doc.select("div.hoverDiv");

But it is not working... So what should be the selecter?

Upvotes: 2

Views: 289

Answers (1)

Pshemo
Pshemo

Reputation: 124215

Update

HTML you showed in your question is not code of the page but probably code generated by JavaScript after page is loaded. Try maybe this way

Document doc = Jsoup.connect("http://www.movieplus.com/hollywood/upcoming/").get();
Elements elements = doc.select(".ListDetails .ListData");
for (Element el : elements) {
    System.out.println(el.select("a[href]").first().attr("href"));
    System.out.println(el.select("img[title]").first().attr("title"));
    System.out.println(el.select(".mRate ,want").text());
    System.out.println(el.select(".relDate").text());
    System.out.println("----------");           
}

Upvotes: 1

Related Questions