I want to fetch some data from my website using Jsoup in my webview. The website is still in development so I can't post any code but here's what I want to achieve:
So the user visits the website where all data I require in the app is loaded onto one page. So I want to fetch all that data as separate strings and use them to fill my table layout. The website has all that I want with each string in a p tag with a unique id.
How can I achieve this? I already have jsoup installed but I can't get my head around how to use it.
Generally if you want to extract element that has id so use select(element_name#id_name)
To extract text that element involves it use .text()
Again show us the html part you want to extract the text from
So try this code
try {
Document doc = Jsoup.connect("your url").get();
System.out.println(doc.select("p#id_name").text());
} catch (Exception e) {
e.printStackTrace();
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments