I tried to scrap the current word-population from this website, but there isnt any number in the span there. Im kinda new in pogramming so it would be helpful if someone could answer my question This is my code:
package org.jsoup.examples;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
public class Main {
public static void main(String[] args) {
try {
Document doc = Jsoup.connect("https://worldpopulationreview.com").userAgent("Mozilla").get();
Elements ele = doc.getElementsByClass("jsx-2221206670");
//System.out.println(ele);
String htmlString = ele.toString();
Document doc2 = Jsoup.parse(htmlString);
Elements ele2 = doc2.getElementsByTag("span");
System.out.println(ele2);
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
Live Population: 7,916,081,627