java - Selecting Display:None With Jsoup -
i practicing jsoup see possibilities amazing parser can do. there 1 thing unable resolve :
i need remove tags display none attribute. 1 obvious way use select :
doc.select("*[style=display:none]").remove();
but doesn't apply cases. sometimes, in style tag, there more 1 property, style="display:none,width...." , someytimes, there spaces, colons etc style="display: none;".
i tried solve applying :
if(!doc.getelementsbyattributevaluecontaining("style", "display").isempty()){ if(!doc.getelementsbyattributevaluecontaining("style", "none").isempty()){ // not sure remove here. } }
what should approach done?
you try valcontaining
construct selector so:
doc.select("*[style*=display:none]").remove();
if not match want, try checking out documentation here more options:
Comments
Post a Comment