java - How to get an element from source code Jsoup -


how go getting questions text tag?

<li>     <a id="nav-questions" href="/questions">questions</a> </li> 

from https://stackoverflow.com/ source code example.

simply select element want, , call text() method on text generates.

in other words use like

elements anchors = document.select(cssquerryforelementsyouwanttofind); for(element : anchors){     system.out.println(a.text()); } 

if have trouble creating cssquerry select part take @ http://jsoup.org/cookbook/extracting-data/selector-syntax


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -