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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -