首页 > 解决方案 > selenium.common.exceptions.WebDriverException:消息:无效参数:无法终止已退出的进程 OSX Catalina

问题描述

我使用 pip brew install gecodriver 安装 instapy ,结果是当我使用 sudo 运行时如果我在没有 sudo firefox 的情况下运行打开 instagram 页面打开登录详细信息输入并输入登录凭据失败的用户并通过是正确的。有人能告诉我这是不是来自 gecodriver 以及我该如何解决它。

> InstaPy Version: 0.6.11 .. .. .. .. .. .. .. .. Workspace in use:
> "/Users/Ammar/InstaPy" Traceback (most recent call last): File
> "instagrambot .py", line 46, in session =
> InstaPy(username=args.username, password=args.password,
> headless_browser=True) File
> "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instapy/instapy.py",
> line 321, in init self.browser, err_msg = set_selenium_local_session(
> File
> "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/instapy/browser.py",
> line 126, in set_selenium_local_session browser = webdriver.Firefox(
> File
> "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/firefox/webdriver.py",
> line 170, in init RemoteWebDriver.init( File
> "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py",
> line 157, in init self.start_session(capabilities, browser_profile)
> File
> "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py",
> line 252, in start_session response =
> self.execute(Command.NEW_SESSION, parameters) File
> "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py",
> line 321, in execute self.error_handler.check_response(response) File
> "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py",
> line 242, in check_response raise exception_class(message, screen,
> stacktrace) selenium.common.exceptions.WebDriverException: Message:
> invalid argument: can't kill an exited process

这是代码

from instapy import InstaPy


if args.username and args.password:
    session = InstaPy(username=args.username, password=args.password, headless_browser=False)
    session.login()
elif args.username and args.password and args.proxy and args.port:
    session = InstaPy(username=args.username, password=args.password, proxy_address=args.proxy, proxy_port=args.port, headless_browser=True)
    session.login()


##Quota Supervisior dhourly and day limits

session.set_quota_supervisor(enabled=True, sleep_after=["likes", "comments_d", "follows", "unfollows", "server_calls_h"], sleepyhead=True, stochastic_flow=True, notify_me=True,
                              peak_likes_hourly=45,
                              peak_likes_daily=1000,
                               peak_comments_hourly=21,
                               peak_comments_daily=182,
                                peak_follows_hourly=48,
                                peak_follows_daily=None,
                                 peak_unfollows_hourly=35,
                                 peak_unfollows_daily=402,
                                  peak_server_calls_hourly=None,
                                  peak_server_calls_daily=4700)

标签: pythonmacosseleniumgeckodriverinstapy

解决方案


推荐阅读