title: How can I interact with a cookies modal using Selenium?
body: <p>I am looking to automate some clicks on this page, which I am using as a test as I am just learning Selenium.</p>
  
  <p><a href="https://www.pgatour.com/competition/2019/safeway-open/leaderboard.html" rel="nofollow noreferrer">https://www.pgatour.com/competition/2019/safeway-open/leaderboard.html</a></p>
  
  <p>I am unable to get my code to automatically accept and close the cookies overlay when I load the page, which is preventing me from getting any further.</p>
  
  <p>I have tried various ways to identify the element, but have received the same message every time.</p>
  
  <p><strong>I believe this is the HTML for the element I need to identify:</strong></p>
  
  <pre><code>&lt;a class="call" tabindex="0" role="button"&gt;Agree and Proceed&lt;/a&gt;
  </code></pre>
  
  <p><strong>The latest version of my code is this:</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>browser = webdriver.Chrome() 
  url = "https://www.pgatour.com/competition/2019/safeway-open/leaderboard.html"
  browser.get(url) 
  cookieaccept = browser.find_element_by_xpath("//a[@class = 'call']")
  cookieaccept.click()
  </code></pre>
  
  <p><strong>The error message is:</strong></p>
  
  <blockquote>
  <pre><code>selenium.common.exceptions.NoSuchElementException:
    Message: no such element: Unable to locate element:
    {"method":"xpath","selector":"//a[@class = 'call']"}
  </code></pre>
  </blockquote>