找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 2378|回复: 1

[求助] python配置求助

1

主题

1

帖子

1

积分

贫民

积分
1
韩电E 发表于 2019-7-24 06:26:33 | 显示全部楼层 |阅读模式
>>> from selenium import webdriver
>>> drive = webdriver.Chrome()
Traceback (most recent call last):
  File "C:\Users\koko\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
    stdin=PIPE)
  File "C:\Users\koko\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 728, in __init__
    errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File "C:\Users\koko\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1052, in _get_handles
    c2pwrite = msvcrt.get_osfhandle(self._get_devnull())
  File "C:\Users\koko\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 867, in _get_devnull
    self._devnull = os.open(os.devnull, os.O_RDWR)
FileNotFoundError: [Errno 2] No such file or directory: 'nul'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    drive = webdriver.Chrome()
  File "C:\Users\koko\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
    self.service.start()
  File "C:\Users\koko\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.excepti**.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

python求助

python求助
回复

使用道具 举报

0

主题

956

帖子

956

积分

圣骑士

积分
956
sheeboard 发表于 2019-7-24 10:09:36 | 显示全部楼层
本帖最后由 sheeboard 于 2019-7-24 10:19 编辑

浏览器驱动是要另外下载的,且版本需要配合浏览器版本,然后加参数executpath='驱动文件所在目录'
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表