I'm using MS Edge with Selenium and Python to do web scraping and having an issue.
Tools and version:
- Microsoft Edge: Version 81.0.416.68 (Official build) (64-bit) Edge
- Driver: msedgedriver.exe (Release 81 | Version: 81.0.410.0 | OS: x86 | https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/)
- Selenium Version: 3.141.0
- Python Version: Python 3.8
Description:
The website I need to access has a security feature. It requires an access code when opening with a new browser. However, once the access code is provided once, it will be remembered if re-visiting with the same browser.
So with the old Edge Legacy browser, since I'd provided the access code once, and the browser was always launched as a normal browser by defualt, not a test browser, so it could access the website without needing a new access code every time because it was remembered. This worked very well.
Issue:
However, now with the new Edge, my Python program is now treated as a test program which launches the browser as new, and so the website requires an access code every time. This is negatively impacting my automation program. Does anyone know how to let the Edge driver open the browser as a normal browser, not a new browser as a test program?
Partial code for reference:
import selenium
from selenium import webdriver
# Locate Edge web driver
driver = webdriver.Edge(executable_path="C://Windows//SysWOW64//msedgedriver.exe")
# Maximize browser for better performance
driver.maximize_window()
# initiate web driver to launch website
driver.get("https://*****************************.com")
# Enter user credential
login_un = driver.find_element_by_id('username').send_keys("USERNAME")
login_pw = driver.find_element_by_id('password').send_keys("PASSWORD")
# Click to log in
driver.find_element_by_id('login_btn_signin').click()