【发布时间】:2019-03-30 21:51:57
【问题描述】:
我正在尝试使用 selenium 登录网站,但在向网站发送用户名和密码时出错:
代码:
driver = webdriver.Chrome(
executable_path='../chromedriver')
driver.get('https://secure.imdb.com/ap/signin?openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fwww.imdb.com%2Fap-signin-handler&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.assoc_handle=imdb_pro_us&openid.mode=checkid_setup&siteState=eyJvcGVuaWQuYXNzb2NfaGFuZGxlIjoiaW1kYl9wcm9fdXMiLCJyZWRpcmVjdFRvIjoiaHR0cHM6Ly9wcm8uaW1kYi5jb20vdjIvbmFtZS9ubTM0NzUyMDk_cmY9Y29uc19ubV9tZXRlciZyZWZfPW5tX3B1Yl91cHNsYl9sb2dpbiJ9&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&imdbPageAction=login')
driver.find_element_by_id("ap_email").send_keys("username")
driver.find_element_by_id("ap_password").send_keys("pass")
driver.find_element_by_id("signInSubmit").click()
报错:
driver.find_element_by_id("ap_email").send_keys("username") 文件“/anaconda3/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py”,第 479 行,在 send_keys “值”:keys_to_typing(value)})
镀铬版本:
铬=70.0.3538.77
chrome 驱动版本:
chromedriver=2.43.600229
如何解决?
【问题讨论】:
-
请将完整错误回溯作为代码格式文本添加到您的问题中。
标签: python selenium selenium-webdriver