简体   繁体   English

如何通过Selenium和Python加载现有的FirefoxProfile

[英]How to load a existing FirefoxProfile through Selenium and Python

First time posting here, so I address a problem I cannot solve.Checked Stackoverflow and google. 第一次在这里发布,所以我解决了一个我无法解决的问题。检查了Stackoverflow和google。 There's some answers for java which I couldn't decode. 有一些我无法解码的答案。 Therefore you might mention that this is a duplicate, but so far no one answered such a question. 因此,您可能会提到这是重复的,但是到目前为止,没有人回答过这样的问题。

Any ideas will be really appreciated. 任何想法将不胜感激。

from selenium import webdriver
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile

from selenium.webdriver.firefox.firefox_binary import FirefoxBinary 
binary = FirefoxBinary(r'C:\Program Files (x86)\MozillaFirefox\firefox.exe')
profile = FirefoxProfile(r'C:\Users\User\Documents\dxcwavid.Zydrius5')
driver = webdriver.Firefox(firefox_profile = profile, firefox_binary = binary)
driver.get("http://google.com")

geckodriver: 0.23.0 壁虎:0.23.0

python: 3.7.1 的Python:3.7.1

selenium: 3.141.0 硒:3.141.0

Windows: 10 1511 Windows:10 1511

Try with: 尝试:

binary = FirefoxBinary("C:\Program Files (x86)\MozillaFirefox\firefox.exe")
profile = FirefoxProfile("C:\Users\User\Documents\dxcwavid.Zydrius5")
driver = webdriver.Firefox(firefox_profile=profile, firefox_binary=binary)
driver.get("http://google.com")

To load an existing Firefox Profile through Selenium and Python you can use the following solution: 要通过SeleniumPython加载现有的 Firefox配置文件 ,可以使用以下解决方案:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Selenium:FirefoxProfile 异常无法加载配置文件 - Selenium: FirefoxProfile exception Can't load the profile 如何使用 FirefoxProfile 或 FirefoxOptions 通过 Selenium 设置 Firefox 浏览器的窗口位置 - How to set window position of Firefox browser through Selenium using FirefoxProfile or FirefoxOptions FirefoxProfile 与 Selenium 的私有模式 - FirefoxProfile with private mode for Selenium Selenium:FirefoxProfile 失败,未找到异常 - Selenium: FirefoxProfile fails with not found exception 消息:错误:轮询更改失败:在通过 Selenium 和 FirefoxProfile 下载文件时尝试获取资源时出现网络错误 - Message: Error: Polling for changes failed: NetworkError when attempting to fetch resource while downloading file through Selenium and FirefoxProfile selenium没有在FirefoxProfile中设置downloaddir - selenium doesn't set downloaddir in FirefoxProfile Python Selenium如何使用现有的chromedriver窗口? - Python Selenium how to use an existing chromedriver window? 如何将 Selenium 连接到现有的 Firefox 浏览器? (Python) - How to connect Selenium to existing Firefox browser? (Python) 模块“selenium.webdriver”没有属性“firefoxprofile” - module 'selenium.webdriver' has no attribute 'firefoxprofile' 如何点击 Google Trends 中的 Load More 按钮并通过 Selenium 和 Python 打印所有标题 - How to click on Load More button within Google Trends and print all the titles through Selenium and Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM