0

I just started using selenium. It seems that when the browser opens it runs with Chrome is Being Controlled by Automated Test Software message.

enter image description here

I am trying to automate some tasks within a website when I'm logged into the website. So I need the browser cookie history, etc. Is it possible to do this with selenium? I don't need an incognito type of browser.

JCode
  • 48
  • 6
  • I know this is not exactly what you're looking for, but maybe it'll help: [How to save and load cookies using Python + Selenium WebDriver](https://stackoverflow.com/questions/15058462/how-to-save-and-load-cookies-using-python-selenium-webdriver) – Dante Culaciati Jan 03 '21 at 04:15
  • Added the answer – PDHide Jan 03 '21 at 04:53

1 Answers1

1

If you check the allowed command line arguments for chromium

https://peter.sh/experiments/chromium-command-line-switches/ ,

We see the below flag , this flag is the reason for showing that prompt:

--enable-automation 

but there is no option to disable it

But when you investigate chromium options':

https://chromedriver.chromium.org/capabilities

You can see that we have :

excludeSwitches:

List of Chrome command line switches to exclude that ChromeDriver by default passes when starting Chrome. Do not prefix switches with --.

So the answer is:

options = webdriver.ChromeOptions()
#options.add_argument('--disable-automation')
options.add_experimental_option(
    "excludeSwitches", ['enable-automation'])

driver = webdriver.Chrome(options=options);
PDHide
  • 18,113
  • 2
  • 31
  • 46