Python + Splinter 实现自动化登录第一步中遇到的问题

来源:互联网 发布:mac下安装启动盘 编辑:程序博客网 时间:2024/05/23 20:25

在这里只是一些遇到的问题,在此备注一下,

Python 与 Splinter 的安装过程就省略了。
  • chromedriver解决办法:
import splinter.browser import Browserb = Browser('chrome') #默认是Firefoxb.visit('http:\\www.baidu.com')
#基础使用splinter的代码,可能会遇到以下的错误:
Traceback (most recent call last):  File "<stdin>", line 1, in <module>  File "build\bdist.win32\egg\splinter\browser.py", line 63, in Browser  File "build\bdist.win32\egg\splinter\driver\webdriver\chrome.py", line 34, in __init__  File "C:\Python27\lib\site-packages\selenium-3.5.0-py2.7.egg\selenium\webdriver\chrome\webdriver.py", line 62, in __init__    self.service.start()  File "C:\Python27\lib\site-packages\selenium-3.5.0-py2.7.egg\selenium\webdriver\common\service.py", line 81, in start    os.path.basename(self.path), self.start_error_message)####selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home 

解决办法: 把下载好的chromedriver.exe 放到Python的安装目录下即可解决这个问题,试了一下Path删掉莫得发现什么问题。(咱手机先这样,后续问题接着写。)

原创粉丝点击