Python Forum
How do I get rid of "Chrome is being controlled by automated test software"?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I get rid of "Chrome is being controlled by automated test software"?
#1
Hello! I'm a new member here.

I've made a code here with a tool that most of you are probably familiar with; Selenium.
The code itself is working fine, but my issue is that I cannot get past the
"Chrome is being controlled by automated test software"-lock in Chrome.

I cannot be logged in to Google and/or Youtube due to "security reasons", because of the Selenium tool.
I have looked up other forums and saw some codes were given to get around this issue,
but they were not helpful and didn't do the job for me at all.
All I want is to remain logged in to Google and Youtube as I'm executing the code.

Any help? Thank you in advance.

Also, I'm new to programming, so please make it easy for me.

from selenium import webdriver
import time

chrome_driver = webdriver.Chrome('D:\PycharmProjects\Refresher\chromedriver.exe')
no_of_driver = int(input("Enter number of drivers: "))
url = input("Enter URL: ")
time_to_refresh = int(input("Enter refresh rate in seconds: "))
drivers = []

for i in range(no_of_driver):
    drivers.append(webdriver.Chrome(executable_path="D:\PycharmProjects\Refresher\chromedriver.exe"))
    drivers[i].get(url)
while True:
    time.sleep(time_to_refresh)
    for i in range (no_of_driver):
        drivers[i].refresh()
Reply
#2
Add in options.
options.add_experimental_option("excludeSwitches", ['enable-automation']) 
Do not use single \ in path becuse of escape character,can add r.
Chrome(r'D:\PycharmProjects\Refresher\chromedriver.exe')
Example.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import time

#--| Setup
options = Options()
#options.add_argument("--headless")
options.add_experimental_option("excludeSwitches", ['enable-automation'])
browser = webdriver.Chrome(executable_path=r'C:\cmder\bin\chromedriver.exe', options=options)
#--| Parse or automation
browser.get("http://www.google.com")
time.sleep(2)
accept_button = browser.find_elements_by_css_selector('#L2AGLb')[0]
accept_button.click()
time.sleep(2)
search_bar = browser.find_elements_by_css_selector('div.a4bIc > input')[0]
search_bar.send_keys('2022')
search_bar.submit() 
Reply
#3
(Feb-23-2022, 07:36 AM)snippsat Wrote: Add in options.
options.add_experimental_option("excludeSwitches", ['enable-automation']) 
Do not use single \ in path becuse of escape character,can add r.
Chrome(r'D:\PycharmProjects\Refresher\chromedriver.exe')
Example.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import time

#--| Setup
options = Options()
#options.add_argument("--headless")
options.add_experimental_option("excludeSwitches", ['enable-automation'])
browser = webdriver.Chrome(executable_path=r'C:\cmder\bin\chromedriver.exe', options=options)
#--| Parse or automation
browser.get("http://www.google.com")
time.sleep(2)
accept_button = browser.find_elements_by_css_selector('#L2AGLb')[0]
accept_button.click()
time.sleep(2)  

search_bar = browser.find_elements_by_css_selector('div.a4bIc > input')[0]
search_bar.send_keys('2022')
search_bar.submit() 
I'm trying this right now, based on something I saw in another discussion on this group, but don't know the syntax for that last line. It doesn't like just "row" in the append. The fetchall is returning a tuple.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I want to create an automated website in python mkdhrub1 2 2,412 Dec-27-2021, 11:27 PM
Last Post: Larz60+
  Expose chrome extension buttons to Python robertjaxe 2 2,345 May-12-2020, 07:52 PM
Last Post: robertjaxe
  Selenium/chrome console WiPi 4 5,900 Apr-12-2020, 11:45 AM
Last Post: WiPi
  Chrome instead of IE Friend 1 2,158 Feb-09-2020, 07:31 AM
Last Post: Larz60+
  Headless Chrome: How to login into a webpage? amandacstr 1 4,307 Feb-06-2020, 02:19 AM
Last Post: metulburr
  Automated Git add/commit/push rxndy 0 2,026 May-13-2019, 11:51 AM
Last Post: rxndy
  Interfacing Google Chrome & Python akornrumpf 5 4,078 Mar-16-2019, 10:20 PM
Last Post: Larz60+
  Cannot open Chrome gahhon 3 3,630 Jan-26-2019, 04:56 AM
Last Post: snippsat
  selenium - chrome crashes when chrome is running. RvBVakama 4 15,296 Dec-16-2018, 06:32 PM
Last Post: metulburr
  Automated Emailer (Using Selenium) StoopidChicken 0 2,976 Jul-17-2018, 07:20 AM
Last Post: StoopidChicken

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020