[英]ERR_TOO_MANY_REDIRECTS error while trying to login through a webpage that uses frames and Javascript using Selenium and Python
I am trying to automate my login to a webpage to download a daily xml.我正在尝试自动登录网页以下载每日 xml。 I understand that I need to have the actual frame url I think is我知道我需要有我认为的实际框架网址
http://shop.braintrust.gr/shop/store/customerauthenticateform.asp http://shop.braintrust.gr/shop/store/customerauthenticateform.asp
I examine the form and the fields and I do the following我检查表单和字段,然后执行以下操作
browser = webdriver.Chrome('C:\\chromedriver.exe')
browser.get('http://shop.braintrust.gr/shop/store/customerauthenticateform.asp')
print('Browser Opened')
username = browser.find_element_by_name('UserID')
username.send_keys(email)
password = browser.find_element_by_name('password')
# time.sleep(2)
password.send_keys(pwd)
but I get a blank page saying that browser did a lot of redirections this means that it is impossible to login?但是我得到一个空白页面,说浏览器做了很多重定向,这意味着无法登录? How can I login?如何登录? thank you谢谢你
ERR_TOO_MANY_REDIRECTS (also known as a redirect loop) is one of the regular website errors. ERR_TOO_MANY_REDIRECTS (也称为重定向循环)是常见的网站错误之一。 Typically this error occurs after a recent change to your website, a mis-configuration of redirects on your server or wrong settings with third-party services.通常,此错误发生在最近更改您的网站、服务器上的重定向配置错误或第三方服务的错误设置之后。
This error have no relation with Selenium as such and can be reproduced through Manual Steps .此错误与Selenium本身无关,可以通过Manual Steps重现。
The reason for ERR_TOO_MANY_REDIRECTS
is that, something is causing your website to go into an infinite redirection loop . ERR_TOO_MANY_REDIRECTS
的原因是,某些原因导致您的网站进入无限重定向循环。 Essentially the site is stuck (such as URL 1
points to URL 2
and URL 2
points back to URL 1
, or the domain has redirected you too many times) and unlike some other errors, these rarely resolve themselves and will probably need you to take action to fix it.本质上,该站点卡住了(例如URL 1
指向URL 2
并且URL 2
指向URL 1
,或者域已将您重定向太多次)并且与其他一些错误不同,这些错误很少会自行解决,可能需要您采取修复它的行动。 There are a couple different variations of this error depending upon the browser you're running.根据您运行的浏览器,此错误有几种不同的变体。
Some common approach to check and fix the error as as follows:一些常见的检查和修复错误的方法如下:
try clearing your cookies.
删除特定站点上的 Cookie :实际上,Google 和 Mozilla 都建议在错误下方try clearing your cookies.
Cookies can sometimes contain faulty data in which could cause the ERR_TOO_MANY_REDIRECTS error. Cookie 有时可能包含错误数据,其中可能导致 ERR_TOO_MANY_REDIRECTS 错误。 This is one recommendation you can try even if you're encountering the error on a site you don't own.这是一项建议,即使您在不属于您的网站上遇到错误,也可以尝试。 Due to the fact that cookies retain your logged in status on sites and other settings, in these cases simply deleting the cookie(s) on the site that is having the problem.由于 cookie 会保留您在站点上的登录状态和其他设置,在这些情况下,只需删除出现问题的站点上的 cookie。 This way you won't impact any of your other sessions or websites that you frequently visit.这样您就不会影响您经常访问的任何其他会话或网站。ERR_TOO_MANY_REDIRECTS
error.或者测试另一个浏览器,看看你是否仍然看到ERR_TOO_MANY_REDIRECTS
错误。ERR_TOO_MANY_REDIRECTS
occur when someone has just migrated their WordPress site to HTTPS and either didn't finish or setup something incorrectly.很多时候,当有人刚刚将他们的 WordPress 站点迁移到 HTTPS 并且没有完成或设置不正确时,会观察到ERR_TOO_MANY_REDIRECTS
发生。ERR_TOO_MANY_REDIRECTS
is also often commonly caused by reverse-proxy services such as Cloudflare. 检查第三方服务: ERR_TOO_MANY_REDIRECTS
也通常是由 Cloudflare 等反向代理服务引起的。 This usually happens when their Flexible SSL option is enabled and you already have an SSL certificate installed with your WordPress host.这通常发生在启用了灵活 SSL 选项并且您已经在 WordPress 主机上安装了 SSL 证书时。 Why?为什么? Because, when flexible is selected, all requests to your hosting server are sent over HTTP.因为选择灵活时,所有对托管服务器的请求都会通过HTTP发送。 Your host server most likely already has a redirect in place from HTTP to HTTPS, and therefore a redirect loop occurs.您的主机服务器很可能已经进行了从 HTTP 到 HTTPS 的重定向,因此会发生重定向循环。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.