First time posting here, so I address a problem I cannot solve.Checked Stackoverflow and 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
python: 3.7.1
selenium: 3.141.0
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:
Code Block:
from selenium import webdriver myprofile = webdriver.FirefoxProfile(r'C:\\Users\\AtechM_03\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\moskcpdq.SeleniumTest') driver = webdriver.Firefox(firefox_profile=myprofile, executable_path=r'C:\\Utility\\BrowserDrivers\\geckodriver.exe') driver.get('https://www.google.co.in') print("Page Title is : %s" %driver.title) driver.quit()
Console Output:
Page Title is : Google
References:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.