【发布时间】:2021-12-02 21:42:33
【问题描述】:
首先,我想在 selenium 控制我的 Firefox 时使用一些插件。
所以,我尝试在 selenium 代码中加载 firefox 的 默认配置文件。
我的代码:
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
profile_path = r'C:\Users\Administrator\AppData\Roaming\Mozilla\Firefox\Profiles\y1uqp5mi.default'
default_profile = FirefoxProfile(profile_path)
driver = webdriver.Firefox(service=service, options=options, firefox_profile=default_profile)
但是,当我启动代码时,DeprecationWarning 发生了:firefox_profile has been deprecated, please pass in an Options object
我搜索了很多,我认为这不是一个困难的问题,但遗憾的是我最终无法解决这个问题,也许我的英语不好困扰我...... ...
【问题讨论】:
标签: python selenium firefox deprecation-warning firefox-profile