python+selenium启动带插件的firefox

python+selenium启动带插件的firefox
在这里插入图片描述点击显示文件夹,获取插件路径
fp=webdriver.FirefoxProfile(r"C:\Users\Administrator\AppData\Roaming\Mozilla\Firefox\Profiles\hwtosi65.default")
driver=webdriver.Firefox(fp)
driver.get(“https://www.baidu.com/”)

tips:
当使用带插件的firefox时,打开网址时容易带缓存,可用如下方法清理缓存:
driver.get (url)

driver.get_cookies()

driver.delete_all_cookies()
driver.get (url)

猜你喜欢

转载自blog.csdn.net/fnms88/article/details/82877014