我想按一下这个按钮,但我的代码不工作。你知道吗
我最后尝试的是:driver.find_element_by_xpath("/html/body/app/main/app/div/div/e-arsiv/taslaklar/div[2]/div/div/div[2]/uc-quick-filter[@type='3M]").click()
我得到一个错误:
elenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression /html/body/app/main/app/div/div/e-arsiv/taslaklar/div[2]/div/div/div[2]/uc-quick-filter[@type='3M] because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '/html/body/app/main/app/div/div/e-arsiv/taslaklar/div[2]/div/div/div[2]/uc-quick-filter[@type='3M]' is not a valid XPath expression.
这是html
您的
text
中缺少一个括起来的单引号。你知道吗绝对xpath不太可取。像这样使用css
使用chrome>;F12>;右键单击element>;copy>;xpath再次尝试复制xpath
相关问题 更多 >
编程相关推荐