【发布时间】:2012-03-07 02:41:03
【问题描述】:
我想避免在我的 java selenium 代码中使用 xpath,但无法弄清楚与下面的代码等效的 css 是什么
("xpath", "//div[@class='error'][not(contains(@style,'display: none'))]");
有没有人知道有没有相当于xpath not contains的CSS
【问题讨论】:
我想避免在我的 java selenium 代码中使用 xpath,但无法弄清楚与下面的代码等效的 css 是什么
("xpath", "//div[@class='error'][not(contains(@style,'display: none'))]");
有没有人知道有没有相当于xpath not contains的CSS
【问题讨论】:
您无法轻松匹配 CSS 中的复合属性(即、style=)。 not 部分很简单——CSS3 有一个:not(...) 选择器。您将不得不找到其他东西来识别要排除的元素,然后使用:not(...) 排除它们,
【讨论】: