0

Here's my code copied from another thread

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("user-data-dir=C:\Users\sc\AppData\Local\Google\Chrome\User Data\Default")
options.add_argument(r'--profile-directory="Default')

driver = webdriver.Chrome(executable_path=r"C:\Users\sc\Desktop\payment verification\chromedriver.exe", chrome_options=options)
driver.get("https://www.google.co.in")

I tried removing the r and adding the '', reinstalling chrome driver but this is the error that I keep facing

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 16-17: truncated \UXXXXXXXX escape
JeffC
  • 22,180
  • 5
  • 32
  • 55
Sushant
  • 29
  • 1
  • You didn't mention which line the error was on. Also, `options.add_argument(r'--profile-directory="Default')` is not a complete/correct string. You have mismatched `"`. – JeffC Mar 24 '23 at 15:37

0 Answers0