title: How to tell google that I accept cookies python
body: <p>I am trying to <strong>accept cookies</strong> and search in google. But I am facing a problem that I never faced before.
  <strong>Webdriver cant find the accept cookies button element</strong>. I looked everything. <strong>I tried to see if something changes the xpath</strong>(Is there any thing triggers any other element so the xpath will change) but I have zero in my hand. I tried using <code>accept.send_keys(Keys.RETURN)</code> and <code>accept.click()</code>. Nothing seems to work.
  What I have for now;</p>
  <pre><code>def GoogleIt():
  path = &quot;C:\Program Files (x86)\chromedriver.exe&quot;
  driver = webdriver.Chrome(path)
  driver.get(&quot;https://google.com&quot;)
  wait(5)
  accept = driver.find_element_by_xpath(&quot;/html/body/div/c-wiz/div[2]/div/div/div/div/div[2]/form/div/div[2]&quot;)
  accept.send_keys(Keys.RETURN)
  accept.click()
  search = driver.find_element_by_xpath(&quot;/html/body/div/div[2]/form/div[2]/div[1]/div[1]/div/div[2]/input&quot;)
  search.click()
  search.send_keys(talk)
  </code></pre>
  <p>Note: wait() is a different name of time.sleep()</p>
  <p><strong>Error;</strong></p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\Teknoloji\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py&quot;, line 1883, in __call__
      return self.func(*args)
    File &quot;C:/Users/Teknoloji/Desktop/Phyton/Assistant V1/Assistant.py&quot;, line 20, in GoogleIt
      accept = driver.find_element_by_xpath(&quot;/html/body/div/c-wiz/div[2]/div/div/div/div/div[2]/form/div/div[2]&quot;)
    File &quot;C:\Users\Teknoloji\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py&quot;, line 394, in find_element_by_xpath
      return self.find_element(by=By.XPATH, value=xpath)
    File &quot;C:\Users\Teknoloji\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py&quot;, line 976, in find_element
      return self.execute(Command.FIND_ELEMENT, {
    File &quot;C:\Users\Teknoloji\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py&quot;, line 321, in execute
      self.error_handler.check_response(response)
    File &quot;C:\Users\Teknoloji\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py&quot;, line 242, in check_response
      raise exception_class(message, screen, stacktrace)
  selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {&quot;method&quot;:&quot;xpath&quot;,&quot;selector&quot;:&quot;/html/body/div/c-wiz/div[2]/div/div/div/div/div[2]/form/div/div[2]&quot;}
    (Session info: chrome=85.0.4183.121)
  
  
  Process finished with exit code -1
  </code></pre>
  <p>If you need more information I am here.
  <strong>Thanks...</strong></p>