当前位置:网站首页>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.
边栏推荐
- CUDA and Direct3D consistency
- ModuleNotFoundError: No module named ‘jieba.analyse‘; ‘jieba‘ is not a package
- Cglib agent - Code enhancement test
- Idea announced a new default UI, which is too refreshing (including the application link)
- selenium备忘录:selenium\webdriver\remote\remote_connection.py:374: ResourceWarning: unclosed<xxxx>解决办法
- TensorRT中的循环
- CUDA中的Warp matrix functions
- Golang -- map capacity expansion mechanism (including source code)
- 注解和反射详解以及运用
- It is said that Kwai will pay for the Tiktok super fast version of the video? How can you miss this opportunity to collect wool?
猜你喜欢

CUDA中的Warp Shuffle

深入学习JVM底层(四):类文件结构

LeetCode 78. subset

Name six schemes to realize delayed messages at one go

Linked list (linear structure)

Redis——Cluster数据分布算法&哈希槽

深入学习JVM底层(二):HotSpot虚拟机对象

Redis - hot key issues

New version of dedecms collection and release plug-in tutorial tool

代码技巧——Controller参数注解@RequestParam
随机推荐
Network related knowledge (Hardware Engineer)
kali最新更新指南
FE - weex 开发 之 使用 weex-ui 组件与配置使用
CUDA中的函数执行空间说明符
MySQL的10大經典錯誤
构建学习tensorflow
CUDA中的动态全局内存分配和操作
深入了解JUC并发(二)并发理论
Use of Arduino wire Library
sprintf_s的使用方法
Sentinel 阿里开源流量防护组件
Browser principle mind map
Log (common log framework)
ctf-web之练习赛
看完有用的blog
链表(线性结构)
When requesting resttemplate, set the request header, request parameters, and request body.
Golang -- map capacity expansion mechanism (including source code)
注解和反射详解以及运用
【每日一题】写一个函数,判断一个字符串是否为另外一个字符串旋转之后的字符串。