urllib3.exceptions.MaxRetryError:HTTPConnectionPool(host ='127.0.0.1',port = 49951):使用Selenium和Python的url超过了最大重试次数 [英] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=49951): Max retries exceeded with url with Selenium and Python

查看:2110
本文介绍了urllib3.exceptions.MaxRetryError:HTTPConnectionPool(host ='127.0.0.1',port = 49951):使用Selenium和Python的url超过了最大重试次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何单击此按钮.它具有图像和文本之类的标识符,但是我不确定如何利用这些标识符来发挥自己的优势.

I have no idea how to click this button. It has identifiers such as an image and text but i'm not sure how i use those to my advantage.

我尝试过使用XPATH,我尝试过使用文本,我尝试过使用图像的链接,但我完全无法使用它

I've tried using the XPATH, i've tried using the text, i've tried using the link of the image, and i cant quite get it to work

我的密码:

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.LINK_TEXT, "Continue Watching"))).click()

按钮HTML:

<button style="margin-top: 15px;
            width: 240px;
            height: 46px;
            background-color: #69b8d6;
            margin: 50px auto;
            border-radius: 4px;
            color: white;
            display: block;
            margin-left: 159px;
            font-size: 16px;"><img style="padding-right:15px;" src="http://img.encrave.tv/global/watchCamcorder.png">Continue Watching</button>

很抱歉,如果此按钮html变成实际的按钮,而我不确定如何处理.

My apologies if this button html turns into an actual button im not really sure how to deal with that.

我的预期结果是找到并等待按钮可单击".然后单击它.我的实际结果是什么也没有发生,并且控制台中弹出错误.

My expected results are to "Find and wait for the button to be clickable." and then click it. My actual results are nothing happens and an error pops up in the console.

提高MaxRetryError(_pool,url,错误或ResponseError(原因))urllib3.exceptions.MaxRetryError:HTTPConnectionPool(host ='127.0.0.1',port = 49951):网址超过了最大重试次数:/session/4100d1e939db4a44f287a50f5e9be234/element(由NewConnectionError(':无法建立新的连接:[WinError 10061]否可以建立连接,因为目标机器被主动拒绝了它))

raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=49951): Max retries exceeded with url: /session/4100d1e939db4a44f287a50f5e9be234/element (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

推荐答案

对我来说,我在元素可以通信之前就杀死了驱动程序实例.因此,只需确认一次,如果您的代码不在config/setup中,就会发生这种情况.

For me, I was killing the driver instance before the element could communicate. So just confirm once if it's not what happening with your code somewhere in config/setup.

这篇关于urllib3.exceptions.MaxRetryError:HTTPConnectionPool(host ='127.0.0.1',port = 49951):使用Selenium和Python的url超过了最大重试次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆