7

I am using Selenium and Chrome. As soon as I try to open automatically a webpage I get the error: Error Message

There are some answers on stackexchange on how to solve this issue in Java/C++ but I could not find any relating to Python. See for example Loading of unpacked extensions is disabled by the administrator

Do someone knows how to fix this problem in python?

KarloKik
  • 83
  • 1
  • 7

1 Answers1

10

After a lot of work on this issue I finally came up with a solution. By looking at the responses on C# and Java I managed to apply same procedure to Selenium in python.

As described in this thread you need to somehow set the attribute of useAutomationExtension to False.

Here is what I did:

from selenium import webdriver

chromeOptions = webdriver.ChromeOptions()
chromeOptions.add_experimental_option('useAutomationExtension', False)

driver = webdriver.Chrome(chrome_options=chromeOptions, desired_capabilities=chromeOptions.to_capabilities())
driver.get("http://www.python.org")

The code above simply creates ChromeOptions class and sets the attribute to false. The you run chrome driver with those options.

This solved my case. I hope it helps.

Moustafa Memet
  • 116
  • 2
  • 5
  • 1
    on ChromeDriver 76.0.3809.68 and chrome 76.0.3809.100 the `useAutomationExtension` option seems to take no effect any more. It worked until versions 75.x.y.z – woodz Aug 13 '19 at 10:27
  • 1
    ~grrr does anybody know how to do this from version 76 onward? – famargar Dec 30 '19 at 09:52