I have a table tag
<table width="100%" align="center"/>
And so far Jsoup provides
Document document =Jsoup.parse(htmlString);
document.select("table[width=100%],table[align=center]");
And this is OR comination i.e. if any one matches then elements are populated. In order to select table having width =100% and align =center I have done following
Elements element =document.select("table[align=center]");
element =element.select("table[width=100%]");
So what I am asking is that just like this OR combination
document.select("table[width=100%],table[align=center]");
is there any AND combination selector i.e. table having width =100% and align =center. Thanks in advance
You can achieve an AND with one query by adding more terms to the selector. In this instance:
Elements tables = document.select("table[width=100%][align=center]");
works.
You can keep adding more terms to make it as precise as required, e.g. table[width=100%][align=center]:contains(text)