当前位置:网站首页>Selenium memo: selenium\webdriver\remote\remote_ connection. Py:374: resourcewarning: unclosed < XXXX > solution
Selenium memo: selenium\webdriver\remote\remote_ connection. Py:374: resourcewarning: unclosed < XXXX > solution
2022-07-02 06:33:00 【bthtth】
Use selenium when ,remote_connection.py Module error resourcewarning terms of settlement
Error code and screenshot
from selenium import webdriver
driver = webdriver.Edge()
driver.get("https://sjz.58.com/")
driver.maximize_window()
The error information is as follows :
XXXXX ResourceWarning: unclosed <socket.socket xxxx>
return self._request(command_info[0], url, body=data)
terms of settlement
Most of the big ways online are ignore warning Method , This is easier to search , You can search by yourself .
Another way is to solve the problem fundamentally , I agree with . The original text is at the back , Thanks to bloggers .
Edge() There is an initialization parameter keep-live, Used to set long connection , The default value is False.
`class WebDriver(RemoteWebDriver):
def __init__(self, executable_path='MicrosoftWebDriver.exe',
capabilities=None, port=0, verbose=False, service_log_path=None,
log_path=None, keep_alive=False)
`
If default values are used , will resourcewarning. So in creating driver At instance time , take keep_alive=True Just bring it in
from selenium import webdriver
driver = webdriver.Edge(keep_alive=False)
driver.get("https://sjz.58.com/")
driver.maximize_window()
original text
link : link.
边栏推荐
- Warp shuffle in CUDA
- Golang--map扩容机制(含源码)
- 代码技巧——Controller参数注解@RequestParam
- 20201025 Visual Studio2019 QT5.14 信号和槽功能的使用
- In depth understanding of JUC concurrency (II) concurrency theory
- PgSQL学习笔记
- 阿里云MFA绑定Chrome浏览器
- Does the assignment of Boolean types such as tag attribute disabled selected checked not take effect?
- 日志(常用的日志框架)
- 一起学习SQL中各种join以及它们的区别
猜你喜欢
随机推荐
10 erreurs classiques de MySQL
注解和反射详解以及运用
Browser principle mind map
Codeforces Round #797 (Div. 3) A—E
Decryption skills of encrypted compressed files
Redis——大Key問題
ModuleNotFoundError: No module named ‘jieba.analyse‘; ‘jieba‘ is not a package
Linear DP (split)
Redis - grande question clé
Arduino Wire 库使用
Kotlin - 验证时间格式是否是 yyyy-MM-dd HH:mm:ss
日志 - 7 - 记录一次丢失文件(A4纸)的重大失误
selenium+msedgedriver+edge浏览器安装驱动的坑
Is there a really free applet?
TensorRT的数据格式定义详解
Data science [viii]: SVD (I)
构建学习tensorflow
CUDA中的Warp matrix functions
Redis - hot key issues
Amazon AWS data Lake Work Pit 1

![Data science [viii]: SVD (I)](/img/cb/7bf066a656d49666985a865c3a1456.png)







