When I run my Selenium 4.1 script in Python 3.10, I get a warning
message that the keyword argument executable_path
is deprecated.
See script below.
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
edge_path = 'edgedriver_win64/msedgedriver.exe'
driver = webdriver.Edge(executable_path=edge_path)
driver.get('https://bing.com')
element = driver.find_element(By.ID, 'sb_form_q')
element.send_keys('WebDriver')
element.submit()
time.sleep(10)
driver.close()
driver.quit()
Warning message:
script.py:13: DeprecationWarning: executable_path has been deprecated,
please pass in a Service object
driver = webdriver.Edge(executable_path=edge_path)
How do I fix this?