Can't find div element with jsoup

I want to extract the red marked information from this site using jsoup.

website

The html text of this site is shown in the following figure. The information I want to extract is red again.

html code of the website

The problem is, I can't find a div element with a class attribute of "found elements". My code looks like this

public static void main(String[] args) {
    try {
        Document doc = Jsoup.connect("https://bestmentor.edudip.com/webinar/Lebe-deine-Berufung-und-deine-Arbeit-ist-Liebe/89620").get();           
        Elements ereignisse = doc.select("div#rating-entries div.found-elements article.rating div.text p");
        //Elements ereignisse = doc.select("body div#com-edudip-main-container div#content div.bottom div.academy-sidebar div.box div.ratings-exist div#rating-entries div.found-elements");        

        System.out.println(ereignisse.size());
        // Selektierte Elemente ausgeben ohne HTML-Tags
        for (Element e : ereignisse) {

            System.out.println(e.cssSelector());
            System.out.println(e.text());
        }
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

      

It would be really nice if someone could help me.

Thank.

+3


source to share


1 answer


It looks like you are targeting content loaded via ajax after page load. Jsoup does not execute the script, but alternatively you can switch to using a mute web browser like Phantomjs



+1


source







All Articles