CSS Selector "combine" Elements -


i'm new css , try parse html via jsoup parser java.

example html:

<p>however beautiful s6 edge looks, doubt [...] <a title="samsung unveils galaxy note 4 , curved screen note edge" href="http://www.example.com/">note edge</a>, dual gently curved screen [...] or accidental palm taps.</p> 

i text inside <p> element follows:

elements text = doc.select("p");          (element element : text) {             system.out.println(element.owntext() + "\n");         } 

output:

however beautiful s6 edge looks, doubt [...] , dual gently curved screen [...] or accidental palm taps.

  1 can see, text note edgeinsde <a> element not showing up.

so wanted ask if there possiblity show entire text, including text inside <a> element follows:

however beautiful s6 edge looks, doubt [...] note edge, dual gently curved screen [...] or accidental palm taps.

i'm greatful every suggestions!

per docs, owntext():

gets text owned element only; does not combined text of children.

you want call element.text(), instead, if want child node's contents included.


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) -