如何删除xpath属性。我想删除/取消选择具有display: none
属性样式的所有对象。
我使用的xpath:
//div[contains(@class,'x-column-header grid-header-ellipses-cls x-column-header') and contains(@style,'auto')]
有超过50个元素具有相同的xpath,但我需要使用display: none;
消除对象。将会有大约10个这样的对象。我该如何处理这样的对象。
HTML代码:
style="border-width: 1px; width: 60px; right: auto; left: 433px; margin: 0px; top: 0px; display: none;"
请分享您的建议
您可以添加另一个AND运算符,并使用NOT删除这些结果:
//div[contains(@class,'x-column-header grid-header-ellipses-cls x-column-header') and contains(@style,'auto') and not(contains(@style, 'display: none')]