Chrome 59 是否支持 URL 中的基本身份验证凭据,以便与 Chromedriver 一起使用?

2023-07-05Python开发问题
6

本文介绍了Chrome 59 是否支持 URL 中的基本身份验证凭据,以便与 Chromedriver 一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

在 Chrome 59 中,对将基本身份验证凭据放入 URL 的支持 - 例如 https://foo:bar@www.foo.com 已经结束 - 不久前在 https://www.chromestatus.com/feature/5669008342777856.

With Chrome 59 the support for putting basic auth credentials in URLs - like https://foo:bar@www.foo.com has ended - this was warned a while ago within https://www.chromestatus.com/feature/5669008342777856.

有没有人不得不使用 Selenium 和 Chromedriver 解决这个问题?特别是在 Python 中?

Has anyone had to work around this with Selenium and Chromedriver yet? Specifically within Python?

推荐答案

在我们的情况下(通过 C# 和 NTLM auth 使用 WebDriver 进行自动测试),我们发现一旦您使用凭据点击页面,尽管您无法加载子-您仍然有权访问该浏览器会话的页面上的资源.

In our situation (automated testing using WebDriver via C# with NTLM auth) we found that once you hit the page with the credentials although you can't load the sub-resources on the page you are still authorized for that browser session.

因此,我们使用有效凭据转到我们不想测试的页面(在我们的例子中是主页),以便在我们的测试套件开始时获得授权.从那时起,我们无需任何凭据即可浏览到要测试的页面,只要我们不关闭会话,一切正常.

So we go to a page that we don't want to test (in our case the home page) with valid credentials in order to get authorized at the start of our test suite. From then on we browse to the pages we want to test without any credentials and so long as we don't close the session everything works.

这篇关于Chrome 59 是否支持 URL 中的基本身份验证凭据,以便与 Chromedriver 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

在xarray中按单个维度的多个坐标分组
groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)...
2024-08-22 Python开发问题
15

Pandas中的GROUP BY AND SUM不丢失列
Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)...
2024-08-22 Python开发问题
17

GROUP BY+新列+基于条件的前一行抓取值
Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)...
2024-08-22 Python开发问题
18

PANDA中的Groupby算法和插值算法
Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)...
2024-08-22 Python开发问题
11

PANAS-基于列对行进行分组,并将NaN替换为非空值
Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)...
2024-08-22 Python开发问题
10

按10分钟间隔对 pandas 数据帧进行分组
Grouping pandas DataFrame by 10 minute intervals(按10分钟间隔对 pandas 数据帧进行分组)...
2024-08-22 Python开发问题
11