java - How to combine the attributes in jsoup selector -


i have parts of html parsing:

<a href="/res/" class="postbtn-reply-href" name="112309691"></a> <blockquote id="m112309691" class="post-message"> text </blockquote> 

how can different attributes?

  • for <a> attribut ["name"]
  • for <blockquote> text()

something like:

elements elements = doc.select("a [class=postbtn-reply-href]["name"], blockquote[class=post-message] [text()]"); 

what css selector?

a.postbtn-reply-href[name], blockquote.post-message:contains(text) 

demo: http://try.jsoup.org/~kpbuk0rx6brmzfzzh-u-u9yvuky


the initial css selector understood below jsoup:

a                              // select node descendant of anchor node (a), [class=postbtn-reply-href]     // having class named postbtn-reply-href ["name"]                       // , attribute called "name" ,                              // or blockquote[class=post-message] // select node descendant of blockquote having class named post-message [text()]                       // , having attribute called text() 

references:


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -