Py学习  »  Python

上次在Python中使用Firefox驱动程序时,如何用数据加载profile?

Kyco9 • 4 年前 • 120 次点击  

打开配置文件“nrec41w9.Tettet”并登录 https://www.gmail.com “然后关闭firefox。之后,打开配置文件“nrec41w9.Tettet”再次转到 https://www.gmail.com “而且它不会继续记录。最重要的是,它一点历史都没有。

from selenium.webdriver.firefox.options import Options
from selenium import webdriver

options = Options()
options.preferences.update({'javascript.enabled': False ,'media.peerconnection.enabled': False})

fp = webdriver.FirefoxProfile (r"C:\Users\Kinosuke\AppData\Roaming\Mozilla\Firefox\Profiles\nrec41w9.Tettet")

browser = webdriver.Firefox(options=options, firefox_profile=fp)

我想用上次使用Selenium的数据打开firefox,它已经“javascript.enabled”:False,“media.peerconnection.enabled”:False”

谢谢你帮我!!!

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/49724
 
120 次点击