I have been trying to do some things on this website with the Selenium Webdriver in Python, but every time the Webdriver opens the webpage, a cookie notification appears which I just cant close/bypass. I have already tried using cookie sessions, but that didnt work either. Here is my code (in which I attempted to use the cookies from my main browser):
from http import cookies
from time import sleep
from selenium import webdriver
from csv import DictReader
driver = webdriver.Firefox()
driver.get("https://www.antenne.de/programm/aktionen/pausenhof-konzerte/die-antenne-bayern-pausenhof-konzerte-2022/")
def get_cookies_values(file):
with open(file, encoding="utf-8-sig") as f:
dict_reader = DictReader(f)
list_of_dicts = list(dict_reader)
return list_of_dicts
cookies = get_cookies_values("cookies.csv")
for i in cookies:
driver.add_cookie(i)
driver.refresh()
If anyone has any idea how to bypass/close the cookie notification or if you need any more information, let me know.