1、报错图片
2、需要将edge的驱动放到python安装目录下,并改名为 MicrosoftWebDriver.exe
3、编写测试代码
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
if __name__ == '__main__':
driver = webdriver.Edge()
driver.get("https://www.baidu.com")
driver.find_element(By.CSS_SELECTOR, '#kw')
sleep(2)
driver.quit()