为什么我会收到一条错误消息“没有模块名称 'msedge'?

Why am I getting an error saying 'No module name 'msedge'?

这是我的代码的前半部分:

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from msedge.selenium_tools import Edge, EdgeOptions

options = EdgeOptions()
options.use_chromium = True
options.add_argument("headless")
options.add_argument("disable-gpu")

driver = webdriver.Edge(executable_path = r"C:\Users\N\Desktop\Automated_Tasks\msedgedriver.exe",options=options) 

当我 运行 代码时,出现以下错误:

ModuleNotFoundError: No module named 'msedge'

听起来好像还没有安装....(" pip install msedge-selenium-tools selenium==3.141 ") 看这里:https://pypi.org/project/msedge-selenium-tools/ 如果你使用的是 Selenium4,你就不需要它,不过.