Python+msedge.selenium_tools+edge加载拓展和用户数据

1.首先准备你需要的.crx拓展

 2.

 from msedge.selenium_tools import EdgeOptions, Edge
options = EdgeOptions()
options.use_chromium = True
#options.add_argument('--headless')

#加载拓展 options.add_extension(r
'C:\Users\**\Documents\ilcoelkkcokgeeijnopjnolmmighnppp_v7.0.0.crx')

#加载用户数据,
--user-data-dir=C:\\ 中间不能有空格
#options.add_argument("--user-data-dir=C:\\Users\\17866\\AppData\\Local\\Microsoft\\Edge\\User Data")

driver = Edge(options= options, executable_path='.\msedgedriver.exe')

3.you get it!

 

posted @ 2021-07-09 18:09  征包  阅读(1745)  评论(0编辑  收藏  举报