java - Parsing using Jsoup -


i ma new java. have string s:

s="<name>header</name><content>good morning</content>" 

how value of content , name using jsoup? jsoup returns when content empty?null?

you can use jsoup:

        connection con2=jsoup.connect(url);         document doc = con2.get();         //or use document doc = jsoup.parse(html);         element e=doc.head().select("meta[name=header]").first();         string url=e.attr("content"); 

http://jsoup.org/cookbook/extracting-data/attributes-text-html

http://jsoup.org/cookbook/extracting-data/selector-syntax

for edit agree answer @hein give you.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -