【发布时间】:2020-03-15 14:30:12
【问题描述】:
好吧,所以我浪费了一整天的自我研究并失败了。所以帮忙? 我创建了一个配置文件,我要做的就是在该配置文件下打开 Firefox,并将其设置为默认值。
这里是代码
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
ff_options = Options()
#profile
binary = FirefoxBinary("C:\\Program Files\\Mozilla Firefox\\firefox.exe")
profile = webdriver.FirefoxProfile('C:\\Users\\bravoj\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\7k4o5psw.CCC Deafualt')
ff_driver = webdriver.Firefox(firefox_profile=profile, firefox_binary=binary, executable_path='C:\\Users\\bravoj\Downloads\\geckodriver.exe')
#fire fox driver
ff_driver.get('about:profiles')
【问题讨论】:
-
您能说说您使用的是哪个版本的 Firefox 浏览器和 webdriver 驱动程序吗?
-
@KiranAntony 它的 70.0.1
标签: python selenium selenium-firefoxdriver firefox-profile