這是我的代碼的前半部分:
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'
uj5u.com熱心網友回復:
聽起來它沒有安裝......(“ pip install msedge-selenium-tools selenium==3.141 ”)在這里看到:https://pypi.org/project/msedge-selenium-tools/如果你使用 Selenium4 你贏了不過,不需要它。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/479403.html
