0

So thats my code, I want to open chrome with my default profile information in selenium. but its doesn't load and crashes when I click on profile icon in chrome

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

options = webdriver.ChromeOptions()
options.add_argument("--user-data-dir=/Users/Library/Application Support/Google/Chrome/Default/Default")
driver = webdriver.Chrome(executable_path='/Users/Desktop/supbot/chromedriver', options=options, service_log_path="/tmp/log")
driver.get('google.com')
1
  • im using add_experimental_option with exclude switches, maybe thats a reason?
    – whyeaye
    Nov 20, 2019 at 14:06

1 Answer 1

0

You should use full path to the driver file like:

C:\pathtodriver\chromedriver.exe

Also, avoid using Capabilities, try this approach:

System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
WebDriver driver = new ChromeDriver();
driver.get('google.com')
1
  • thats don't work
    – whyeaye
    Nov 20, 2019 at 13:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.