I am using the Jsoup library to read a URL. This url has text within a few tags. Is it possible for me to obtain the text within each
According to your case the solution will be as below.
Document doc = Jsoup.connect("http://www.example.com").timeout(10000).get();
Elements scripts = doc.select("script");
for (Element script : scripts) {
String type = script.attr("type");
if (type.contentEquals("text/javascript")) {
String scriptData = script.data(); // your text from the script
break;
}
}