I am trying to access a site and use my current firefox profile so I do not get prompted to enable location services. I have looked all around and can’t find a direct solution to my problem. This is the current code I have:
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
fp = webdriver.FirefoxProfile('C:UserstommyAppDataRoamingMozillaFirefoxProfilesjfrxn7d4.default-release')
driver = webdriver.Firefox(fp)
driver.get("https://www.google.com/")
**Error Message I recieve:
**
File “C:UserstommyOneDriveDesktopProjTaskFirstTry”, line 5
fp = webdriver.FirefoxProfile(‘C:UserstommyAppDataRoamingMozillaFirefoxProfilesjfrxn7d4.default-release’)
^
SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: truncated UXXXXXXXX escape
I have tried different ways to reach the path to my firefox profile and open it, but nothing seems to work.
Thomas Tsiftilis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.