3

Why is it when I launch a simple script I get the below image (too low to show image here).

Basically it gives me: developer mode extensions pop up in Chrome

from selenium import webdriver

driver = webdriver.Chrome()
driver.get('http://google.com.uk')
driver.close()

Apparently this is a quick fix:

ChromeOptions options = new ChromeOptions();
options.addArguments("chrome.switches","--disable-extensions");
System.setProperty("webdriver.chrome.driver",(System.getProperty("user.dir") + "//src//test//resources//chromedriver_new.exe"));
driver = new ChromeDriver(options);

My question is, how can I get rid of this without some band aid solution? I did not get this yesterday. Is there a way or reinstall only way to go.

enter image description here

LuFFy
  • 8,799
  • 10
  • 41
  • 59
  • The short answer is that the chrome developers want chrome extensions installed from the app store only. Since chrome is automatically updated, they constantly roll out more restrictions to enforce that. – xaav Dec 12 '17 at 05:41
  • @xaav How do I get around it? I did not have problem yesterday. Is it corrupt files? –  Dec 12 '17 at 05:42
  • Probably chrome was updated without asking you. I don't know what they've done this time, but it's always going to be a game of whack a mole. – xaav Dec 12 '17 at 05:43
  • @xaav Can you use selenium normally? if there is no solution I'll do full reinstall assuming my files are corrupted or something –  Dec 12 '17 at 05:45

1 Answers1

0

To get rid of Developer Mode Extensions pop up in Chrome Browser you can use the following code block :

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

options = Options()
options.add_argument("start-maximized")
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\path\to\chromedriver.exe')
driver.get('https://www.google.co.in')
print("Page Title is : %s" %driver.title)
driver.quit()

Reference

You can find a detailed discussion in:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352