1

For a web-test i call an online-shop which uses a special GDPR-cookie-banner. When I call this online store in a normal chrome browser, it is loaded and displayed.

However, when I call this online store with the test software (chromedriver, Selenium, Python), it is loaded but not displayed.

What is the reason and what can I do to display this banner?

Online-shop: https://www.uwaldu.de/

Browser snapshot with normal chrome browser:

enter image description here

Browser snapshot with webdriver:

enter image description here

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Marvin.H
  • 67
  • 10

2 Answers2

1

Not sure why you won't see the special GDPR-cookie-banner. But when I access the website using a Selenium driven ChromeDriver initiated Browsing Context the GDPR-cookie-banner is displayed perfectly everytime.

Code Block:

options = Options()
options.add_argument("start-maximized")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
options.add_argument('--disable-blink-features=AutomationControlled')
s = Service('C:\\BrowserDrivers\\chromedriver.exe')
driver = webdriver.Chrome(service=s, options=options)
driver.get("https://uwaldu.de/")

Browser Snapshot:

GDPR

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Thank you very much. After I added "--disable-blink-features=AutomationControlled" to my driver, I was able to see the banner. Without this argument, the banner stays away. Thank you very much for this hint. – Marvin.H Dec 28 '21 at 18:02
0

It would help if you use chrome's "user agent" as some websites would load the banner only based on the browser and its properties.

EX: options.add_argument("--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36")

aakarsh
  • 21
  • 4