Selenium有错误Traceback(最近一次调用最后一次):文件“<pyshell#3>”,第1行,在<module>中fb_login()

时间:2017-07-20 00:26:29

标签: python selenium scrapy-shell

我有以下代码可以帮助我自动填写我的数据并登录:

 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()

但是我收到以下错误:

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)

任何人都可以帮我看看并检查我的错误吗?

0 个答案:

没有答案