【问题标题】:Pythonanywhere "permission denied" when reading an executable file读取可执行文件时Pythonanywhere“权限被拒绝”
【发布时间】:2021-11-17 08:37:38
【问题描述】:

我想在任何地方通过 python 使用 Selenium。我已经在本地测试了我的脚本,一切都很好。一个关键点是 chromedriver 是一个必需的可执行文件。我将它上传到目录/home/user/docs/chromedriver。当我按预期将此路径传递给函数时,会返回权限错误selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium. org/chromedriver/home

当我检查我得到的文件的权限时:

$ ls -l chromedriver 
-rw-rw-r-- 1 user registered_users 11924296 Sep 24 01:21 chromedriver 

我不能 100% 确定这意味着什么,但是,我希望 x 作为其可执行文件出现。我应该更改权限(什么以及如何)? 还有其他推荐吗?

【问题讨论】:

  • chmod 755 chromedriver

标签: python linux permissions selenium-chromedriver pythonanywhere


【解决方案1】:

PythonAnywhere 上已经安装了一个 chromedriver,它可以与 PythonAnywhere 上提供的 Chrome 一起使用。您不需要上传自己的版本,如果版本不正确,它将无法正常工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-08
    • 1970-01-01
    • 2016-04-15
    • 1970-01-01
    • 2018-07-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多