首先,我想要在Selenium控制Firefox时使用一些插件。
因此,我尝试在Selenium代码中加载Firefox的默认配置文件。
我的代码:
所以,我尝试在Selenium代码中加载默认配置文件 。
我的代码:
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已经被弃用,请传入一个Options对象
我搜索了很多资料,我不认为这是一个难题,但可悲的是最终我无法解决这个问题,也许是我的英语不好阻碍了我... ...