python+selenium定位元素
<ul class="ivu-tree-children" visible="visible">下面有好多<ul class="ivu-tree-children">我需要定位没有 visible="visible"属性的元素该怎么做?
ul = wd.find_elements(By.XPATH, '//ul[@class="ivu-tree-children" and not @visible="visible"]')和ul = wd.find_elements(By.XPATH, '//ul')这么写都好像不太对
最好把网址或是其它信息也贴一下,好方便调试 你可以试试其他方式定位呀 建议用css定位方式 ul = wd.find_elements(By.XPATH, '//ul[@class="ivu-tree-children" and @visible!="visible"]')
试试这个
页:
[1]