I am trying to get the content from <div class="article__content"> but I got NullPointerException, I dont really know how to solve this as I dont have that much web knowledge maybe I am using the tags incorrectly :/ Here is my code:
public static void main(String []args) throws IOException {
Document doc = Jsoup.connect("somelink").get();
String content = doc.getElementById("article__content").text();
System.out.println(content);
}
divby itsclassbut you are callinggetElementById, notgetElementsByClass. Could that be where the problem lies?