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
Post a Comment