蜡笔小新不秃头 2020-12-25 10:14 采纳率: 100%
浏览 195
已采纳

想要用selenium模拟打开chorme结果报错?

 

from selenium import webdriver

driver = webdriver.Chrome('/usr/local/bin')

driver.get('https://www.baidu.com/')

以上是一段代码

 

以下是报错

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 72, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/usr/local/bin'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/youwenhao/pythonProject/666.py", line 4, in <module>
    driver = webdriver.Chrome('/usr/local/bin')
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 86, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'bin' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home
  • 写回答

2条回答 默认 最新

  • viewgroup 2020-12-25 10:40
    关注

    PermissionError: [Errno 13] Permission denied: '/usr/local/bin'

    已经给提示了呀。。你没有权限调用bin目录下的东西。。所以driver.chrome 就没有办法启动

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改