我进入我的第一个星期学习python,并期待着自动登录到一个网站。我可以进入该网站,并获得用户名和密码输入,但问题是提交/登录按钮。我已经尝试使用相同的用户名和密码使用下面的,但它没有找到这个id,我正在使用检查工具在chrome上找到的id,因为我做了用户名和密码。你知道吗
driver.find_element_by_id('GSubmitButtton-8f6df913-9588-4480-9944-538b785b8ece').click()
错误消息
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="GSubmitButtton-8f6df913-9588-4480-9944-538b785b8ece"]"}
driver.find_element_by_id('GSubmitButtton-8f6df913-9588-4480-9944-538b785b8ece').click()
是否可以使用XPath来定位登录按钮?你知道吗
您可以通过以下方式找到:
然后将结果输入此行(替换####)
driver.find_element_by_xpath("###").click()
Some documentation for this method here!
相关问题 更多 >
编程相关推荐