from selenium import webdriver
设置Edge浏览器的可执行文件路径(根据你的安装路径进行修改)
edge_path = r"D:\Pyobject2023\venv\Scripts\MicrosoftWebDriver.exe"
创建一个ChromeOptions对象,并设置远程调试端口
options = webdriver.EdgeOptions()
options.add_experimental_option("debuggerAddress", "127.0.0.1:9088")
初始化WebDriver实例
driver = webdriver.Edge(executable_path=edge_path, options=options)
driver.get('http://baidu.com')
以上代码提示:Traceback (most recent call last):
File "D:\Pyobject2023\object\Python-mind\OA流程\88测试.py", line 12, in
driver = webdriver.Edge(executable_path=edge_path, options=options)
TypeError: init() got an unexpected keyword argument 'executable_path'