title: Python Selenium accept cookies
body: <p>I need to accept cookies on a specific website but I keep getting the <code>NoSuchElementException</code>. This is the code for entering the website:</p>
  <pre><code>from selenium import webdriver
  from selenium.webdriver.chrome.options import Options
  import time
  
  
  chrome_options = Options()
  driver = webdriver.Chrome(executable_path='./chromedriver', options=chrome_options)
  
  page_url = 'https://www.boerse.de/historische-kurse/Erdgaspreis/XD0002745517'
  driver.get(page_url)
  
  time.sleep(10)
  </code></pre>
  <p>I tried accepting the cookie button using the following:</p>
  <pre><code>driver.find_element_by_class_name('message-component message-button no-children focusable button global-font sp_choice_type_11 last-focusable-el').click()
  driver.find_element_by_xpath('//*[@id=&quot;notice&quot;]').click()
  driver.find_element_by_xpath('/html/body/div/div[2]/div[4]/div/button').click()
  </code></pre>
  <p>I got the xpaths from copying the xpath and the full xpath from the element while using google chrome.</p>
  <p>I am a beginner when it comes to selenium, just wanted to use it for a short workaround. Would appreciate some help.</p>