首頁 > 後端開發 > Python教學 > 如何使用 Selenium 繞過 Python 中的 Windows 驗證問題?

如何使用 Selenium 繞過 Python 中的 Windows 驗證問題?

DDD
發布: 2024-11-15 06:36:02
原創
326 人瀏覽過

How to Bypass Windows Authentication Issues in Python with Selenium?

Resolving Authentication Issues in Python with Windows Authentication

When attempting to enter data into a prompt using Python's selenium module, you may encounter issues with Windows Authentication not working. This article addresses such difficulties by providing a solution in the Python environment.

Utilizing Selenium 3.4.0, geckodriver v0.18.0, Mozilla Firefox 53.0, and Python 3.6.1, authentication can be bypassed by embedding both the username and password directly into the URL itself.

To resolve the issue, open the URL with the embedded credentials as follows:

from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary('C:\\Program Files\\Mozilla Firefox\\firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary, executable_path="C:\\Utility\\BrowserDrivers\\geckodriver.exe")
driver.get("http://admin:[email protected]/basic_auth")
登入後複製

以上是如何使用 Selenium 繞過 Python 中的 Windows 驗證問題?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板