小编Cha*_*ang的帖子

selenium.common.exceptions.WebDriverException:消息:未知错误:net::ERR_CONNECTION_RESET

我对这些技术很陌生。
我的操作系统是 ubuntu-18.04,并使用 anaconda 创建一个虚拟环境,并通过 pip 安装和所有必要的软件包。我还安装了相同版本的 Chrome 和 chromedriver 来运行 selenium。我还在/etc/systemd/system下创建了一个test.service

我无法在 stackoverflow 中发布图片。该问题可以在屏幕截图中使用命令 ( )
看到sudo systemctl status test

Gunicorn[25770]:文件“/home/anaconda/port8788/hct/hct_information.py”,第21行,在testDriver中
gunicorn[25770]:driver.get(url)
gunicorn[25770]:文件“/home/chaoyang/anaconda3 /envs/selenium/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py”,第 333 行,在 get
Gunicorn[25770] 中:self.execute(Command.GET, {'url': url })
gunicorn[25770]:文件“/home/chaoyang/anaconda3/envs/selenium/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py”,第321行,执行
gunicorn[25770] :self.error_handler.check_response(响应)
gunicorn[25770]:文件“/home/chaoyang/anaconda3/envs/selenium/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py”,第242行,在 check_response
Gunicorn[25770] 中:引发异常类(消息、屏幕、堆栈跟踪)gunicorn[25770]:selenium.common.exceptions.WebDriverException:消息:未知错误:net::ERR_CONNECTION_RESET Gunicorn[25770]:(会话信息:无头镀铬=86.0.4240.183)

我的烧瓶代码如下:

import flask
from flask import request
import argparse
from hct import hct_information as hct

app = flask.Flask(__name__)

@app.route("/test")
def test():
    return hct.testDriver('https://www.google.com/')

if __name__ == "__main__":
    app.run(debug=True, host='0.0.0.0')
Run Code Online (Sandbox Code Playgroud)

我的硒代码如下:

from selenium import webdriver
from selenium.webdriver.chrome.options …
Run Code Online (Sandbox Code Playgroud)

python gunicorn selenium-webdriver nginx-reverse-proxy ubuntu-18.04

5
推荐指数
1
解决办法
9440
查看次数