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:
- jsoup selector syntax
- jsoup 1.8.3
Comments
Post a Comment