java - extract language from a web page with Jsoup -
for example have <html lang="en"> ...... web page </html>
i want extract string "en" jsoup.
i tried selector , attribute without success.
org.jsoup.nodes.document htmldoc = jsoup.parse(html); element taglang = htmldoc.select("html").first(); system.out.println(taglang.text());
looks want value of lang
attribute. in case should use attr("nameofattribute")
like
system.out.println(taglang.attr("lang"));
Comments
Post a Comment