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

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -