Search code examples
javajsoup

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?


Solution

  • 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("----------");           
    }