Python Selenium3 使用新版Edge瀏覽器


下載對應版本的MicrosoftWebDriver.exe:

WebDriver - Microsoft Edge Developer

網上教程很多,不再重復

關鍵來了,Selenium3 不支持新版Edge,網上的教程就沒見過有用的,必須額外安裝py包:
 
pip install msedge-selenium-tools selenium==3.141
 
使用:
from msedge.selenium_tools import Edge, EdgeOptions
 
driver_url = 'MicrosoftWebDriver.exe位置'
options = EdgeOptions()
options.use_chromium = True
options.add_extension(extension_path) # 加載擴展列表
browser = Edge(options = options,executable_path=driver_url)
 
剩下的操作沒有變化,就可以正常使用Selenium了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM