Selenium with error Traceback (most recent call last): File “<pyshell#3>”, line 1, in <module> fb_login()

北慕城南 提交于 2019-12-24 20:31:00

问题


I have the following code that help me auto fill in my data and login:

 import webbrowser
 from selenium import webdriver
 import time

 def fb_login():
     br=webdriver.Chrome('C:/Python34/Scripts/chromedriver.exe')
     br.get('https://www.facebook.com/')
     time.sleep(5)
     user=br.find_element_by_css_selector('#email')
     user.send_keys('vivian@hotmail.com')
     password=br.find_element_by_css_selector('#pass')
     password.send_keys('9416@io')
     login=br.find_element_by_css_selector('#u_0_t')
     login.click()
     fb_login()

but i get the following error:

Traceback (most recent call last):File "<pyshell#3>", line 1, in <module>
fb_login()File "C:\Users\SHIJIETI\Desktop\STUPID.py", line 14, in fb_login
login.click()
File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webelement.py", line 77, in click
self._execute(Command.CLICK_ELEMENT)
File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webelement.py", line 493, in _execute
return self._parent.execute(command, params)
 File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 256, in execute
self.error_handler.check_response(response)
 File "C:\Python34\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
 (Session info: chrome=59.0.3071.115)
 (Driver info: chromedriver=2.30.477700 (0057494ad8732195794a7b32078424f92a5fce41),platform=Windows NT 10.0.14393 x86_64)

Any one can help me see and check my error?

来源:https://stackoverflow.com/questions/45203176/selenium-with-error-traceback-most-recent-call-last-file-pyshell3-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!