如何使用 python 在 Selenium 中自动化安全加密站点?

How to automate secure encrypted sites in Selenium using python?

我是 Python 的新手。我正在尝试通过在 Selenium 中打开登录页面来实现自动化。

from selenium import webdriver
browser = webdriver.Chrome(executable_path='chromedriver')

我尝试测试了一些网站,例如 - 'https://www.google.com/' 等。这工作得很好。

url = 'https://www.google.com/'
browser.get(url)

我正在尝试打开 url,

url = 'https://yesonline.yesbank.co.in/index.html?module=login'
browser.get(url)

我在 selenium 浏览器中遇到以下错误,而 url 在没有 selenium 的情况下工作正常。

Access Denied

You don't have permission to access "http://yesonline.yesbank.co.in/index.html?" on this server.

Reference #18.ef87d317.1625646692.41fe4bc0

但是当我试图打开基础 url 时,它正在打开,但网站部分加载并继续显示加载。

url = 'https://yesonline.yesbank.co.in'
browser.get(url)

我觉得我在打开登录时遗漏了一些东西url,我无法得到确切的东西。

我也尝试过更改网络驱动程序,即使用 Firefox。

url = 'https://yesonline.yesbank.co.in'
firefox_browser = webdriver.Firefox()

你猜怎么着,它正在开幕! 但是一旦我尝试获取登录页面(即使通过手动使用鼠标并单击登录页面)。

url = 'https://yesonline.yesbank.co.in/index.html?module=login'
firefox_browser.get(url)

'firefox_browser' 因会话重置错误而关闭。

有人可以帮助我如何在 selenium 中打开安全站点。或者有没有其他方法可以完成。

通过向其添加一些参数,它最终与 chrome-驱动程序一起工作。

from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('disable-infobars')
options.add_argument('--disable-extensions')
options.add_argument('--disable-blink-features=AutomationControlled')

browser = webdriver.Chrome(executable_path='chromedriver', options = options)