python - 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)
解决方案
推荐阅读
- vue.js - 方法中的导入和调用函数不起作用
- java - 当打开同一窗口的多个实例时,将数据传递到所需的窗口 Java
- microsoft-graph-api - 有没有办法将响应对象值从第一个请求传递到第二个请求作为图形批处理请求中的输入参数
- asp.net-core - 为什么模型绑定不起作用?ASP.NET Core 5.0 RazorPages
- c++ - Runnable 函数的 C++ 模板
- java - 如何显示提取数据的第一行结果?
- ios - UITableView:如何从底部滚动(如对话列表)?
- terraform - Terraform 同时使用 required_providers 和 provider 块
- javascript - 为什么在这个程序中忽略了 setTimeout?
- python - 如何在toplevel()Tkinter中使用画布制作按钮