我正在尝试使用 python Selenium Chrome 驱动程序登录 openload.co,但出现以下错误:
Message: element not interactable
我正在使用以下代码,错误发生在代码的最后一行,我无法将 key 发送到输入标签。
from selenium import webdriver
path="path_to_chrome_driver" #add chromedriver path
driver=webdriver.Chrome(path)
from selenium.webdriver.common.keys import Keys
driver.get('https://openload.co/login')
email = driver.find_element_by_xpath('//*[@id="loginform-email"]')
email.send_keys("example@xyz.com")
我在 stackoverflow 上搜索了这个问题并找到了以下链接 similar question这表示它可能没有指向正确的 xpath 或 css_selector。但是我好像找不到。 我在这里做错了什么?
最佳答案
这是因为当您单击右上角的“登录”按钮时,HTML 中有一个模式可见。有重复的ID。您可以尝试像这样传递密码和用户名 http://username:password@openload.co/ ?
@john 试试这个,对我有用:
driver.get('https://openload.co/login')
emails = driver.find_elements_by_xpath('//*[@id="loginform-email"]')
emails[1].send_keys("example@xyz.com")
关于python - 如何使用 python selenium 登录 Openload.co?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53997409/