title: How to make selenium wait until the element is found instead of using time.sleep()
body: <p>Basically the tittle, i'm building a small script to automate some basic stuff. I've been using time.sleep() to make the software wait a little until everything is loaded, but is there a better way to do this??</p>
  <p>I want the script to wait as long as necessary by itself to make things faster and more clean.</p>
  <pre><code>from selenium import webdriver
  
  from selenium.webdriver.common.keys import Keys
  from selenium.webdriver.chrome.options import Options
  from selenium.webdriver.support.ui import Select
  import time
  from tkinter import *
  
  
  def cs_update():
  
      PATH = &quot;C:\Program Files (x86)\chromedriver.exe&quot;
      options = Options()
      options.headless = True
  
  
  
      driver = webdriver.Chrome(PATH,options = options) 
      driver.set_window_size(1920,1080)
      driver.minimize_window()
  
      user_email = e.get()
      user_password = e2.get()
  
      driver.get(&quot;https://www.compraensanjuan.com&quot;)
      time.sleep(3)
  
  
      link = driver.find_element_by_link_text(&quot;Mi cuenta&quot;)
  
      link.click()
      time.sleep(3)
  
      email = driver.find_element_by_name(&quot;email&quot;)
  
      email.send_keys(user_email)
  
      print(&quot;I sent the keys&quot;)
  </code></pre>