maic0L
maic0L

Reputation: 45

Getting rid of "Chrome is being controlled by automated software" using selenium, chromedriver

I am trying to get rid of the "Chrome is being controlled.." message using some of the most suggested options, here is the code:

def start(self):
    options = Options()
    options.add_argument('start-maximized')
    options.add_argument('disable-infobars')
    options.add_experimental_option("excludeSwitches", ["enable-automation"])
    options.add_experimental_option('useAutomationExtension', False)
    options.binary_location = r'C:\Users\User\Desktop\chromedriver.exe'
    self.driver = webdriver.Chrome(ChromeDriverManager().install(), options=options)

However, it shows this error

(The process started from chrome location C:\Users\User\Desktop\chromedriver.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

As if ChromeDriverManager() was not taken as a valid argument, so I tried using executable_path=ChromeDriverManager() but still won't work.

Upvotes: 1

Views: 3295

Answers (1)

Anand Gautam
Anand Gautam

Reputation: 2101

options.binary_location = r'C:\Users\User\Desktop\chromedriver.exe'

This line is not required when you are using webdriver_manager to invoke Chrome browser. As I see it, the webdriver_manager is conflicting with the option of binary location. Your code should work good if you omit the line above stated.

Upvotes: 2

Related Questions