• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home » Resolved: Selenium / Accept cookie-window?

Resolved: Selenium / Accept cookie-window?

0
By Isaac Tonny on 15/03/2023 Issue
Share
Facebook Twitter LinkedIn

In this post, we will see how to resolve Selenium / Accept cookie-window?

Question:

i would like to automate the following site: https://atlas.immobilienscout24.de/
using this code:
When the site opens there allways appears this cookie-window and i am not able to press the accept button with the above code.
enter image description here
Instead i allways get this timeout-exception:
How can i close this cookie-window?

Best Answer:

The element Alle bestätigen is within #shadow-root (open)
shadow_content

Solution


To click on the element Alle akzeptieren you need to use shadow_root attribute and you can use the following locator strategies:

References


You can find a couple of relevant detailed discussions in:
  • How to extract info within a #shadow-root (open) using Selenium Python?
  • How to get past a cookie agreement page using Python and Selenium?

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

python selenium-webdriver
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: std::regex_replace to replace multiple combinations

26/03/2023

Resolved: How can I copy files using the ansible.builtin.copy module and avoid conflicting file names?

26/03/2023

Resolved: Reshape tensors of unknown shape with tf.function

26/03/2023

Comments are closed.

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.