我刚刚开始了我的第一个使用python的selenium项目。 我的第一个任务是使用“Sign to chrome”按钮登录到chrome,但是我不能点击它:Sign to chrome button
按钮HTML:
<paper-button class="action-button" role="button" tabindex="0" animated="" aria-disabled="false" elevation="0">
Sign in to Chrome
</paper-button>
我试过:
driver = webdriver.Chrome()
driver.find_element_by_class_name('action-button').click()
driver.find_element_by_xpath('//paper-button[@class='action-button']').click()
driver.find_element_by_css_selector('paper-button.action-button').click()
什么都没用。你知道吗
错误:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"paper-button:not([raised]).action-button"}
请尝试使用AutoIt pip,您可以尝试以下代码:
安装Autoit:
使用以下代码:
让我知道它是否有效。你知道吗
相关问题 更多 >
编程相关推荐