美文网首页
Ubuntu 18.04+selenium 错误 can't k

Ubuntu 18.04+selenium 错误 can't k

作者: OCeasyLife | 来源:发表于2019-05-09 17:13 被阅读0次

    如以下错误:

    1.selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process

    2.或selenium.common.exceptions.WebDriverException:Message: Process unexpectedly closed with status:1

    selenium出现这个错误是因为脚本在root用户下运行导致,若你用的是firefox,firefox geckodriver的log中出现以下错误提示:
    Running Firefox as root in a regular user's session is not supported. ($HOME is /root which is owned by www.)

    使用chrome也有类似报错;

    明确原因是Firefox不支持root用户;

    解决方案:
    1.新建新用户
    2.在新用户下运行相应的脚本
    3.如果有文件的读写权限问题,请赋予相应的权限

    相关文章

      网友评论

          本文标题:Ubuntu 18.04+selenium 错误 can't k

          本文链接:https://www.haomeiwen.com/subject/ngqgoqtx.html