title: How to click a random link from google search results through Selenium and Python
body: <p>Currently using Selenium+ Python and this code: </p>
  
  <pre><code>browser.get('http://www.google.com')
  search = browser.find_element_by_name('q')
  search.send_keys("how to search the internet")
  search.send_keys(Keys.RETURN) # hit return after you enter search text
  time.sleep(5) # sleep for 5 seconds so you can see the results
  browser.execute_script("window.scrollTo(0, 873)") 
  time.sleep(2)
  browser.find_element(By.XPATH, '(//h3)[3]/a').click()`
  </code></pre>
  
  <p>as my code. </p>
  
  <p>What Happens: Goes to Google and types in the words and hits search. Scrolls down a bit and then it clicks the first link</p>
  
  <p>What I want: I want to be able to click a random link from the search result page</p>
  
  <p>How to do this? </p>
  
  <p>Edit: This is what I meant when I said unnecessary:
  Unnecessary 1: <a href="https://imgur.com/a/70qz89x" rel="nofollow noreferrer">https://imgur.com/a/70qz89x</a></p>
  
  <p>Unnecessary 2: <a href="https://imgur.com/a/8WWvcnC" rel="nofollow noreferrer">https://imgur.com/a/8WWvcnC</a> </p>
  
  <p>These are the only results I want: 
  This: <a href="https://imgur.com/a/eTatFV9" rel="nofollow noreferrer">https://imgur.com/a/eTatFV9</a></p>