java - extract Element from div with jSoup returns null -


i'm trying extract string web page: https://play.google.com/store/apps/details?id=com.bitmango.rolltheballunrollme. string want in: <div class="id-app-title" tabindex="0">roll ball™ - slide puzzle</div>.

i've looked @ https://jsoup.org/cookbook/extracting-data/selector-syntax , i'm pretty sure i'm following instructions, i'm getting:

exception in thread "main" java.lang.nullpointerexception @ gaspacho.gaspacho.getapptitle(gaspacho.java:109) @ gaspacho.gaspacho.alphabetty(gaspacho.java:94) @ gaspacho.gaspacho.main(gaspacho.java:27) /home/david/.cache/netbeans/8.1/executor-snippets/run.xml:53: java returned: 1 build failed (total time: 3 seconds) 

this method i'm using:

public void getapptitle(string url){     try {         document document = jsoup.connect(url).get();          element apptitleelement = document.select("div.id-app-title" ).first();          string title = apptitleelement.tostring();          system.out.println(title);      } catch (ioexception e) {         e.printstacktrace();     } } 

any can give appreciated


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -