OS - Windows 10 Selenium - 4 Python - 3.9.7 Browser - MS Edge (v97) Edge Driver (v97)
Whilst the following code works, albeit with an error thrown, it seems (according to MS) that the Selenium 4 approach is to use 'official EdgeOptions and EdgeDriver classes from the OpenQA.Selenium.Edge namespace':
import unittest
from selenium import webdriver
from selenium.webdriver.edge import service
from selenium.webdriver.edge.options import Options
class Login(unittest.TestCase):
def setUp(self):
s=service.Service(r'C:\Users\Path_to_driver\msedgedriver.exe')
self.driver = webdriver.Edge(service=s)
url = "https://my_website"
self.driver.get(url)
Thing is, as a newbie to Python OO and Selenium, i'm badly floundering on how to do this and all of my web searches have failed to provide an answer that I can understand. I can't even find OpenQA.Selenium.Edge, EdgeOptions or EdgeDriver, which is not a good start! :-/
Ideally i'd like to use the Selenium 4 method and so i'd be really grateful if anyone can provide me with some pointers. TIA