Reputation: 83
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?
Upvotes: 7
Views: 9014
Reputation: 126
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.
Upvotes: 10