title: How can I select a date in a DatePicker with selenium using python
body: <p>I want to select a date from this <a href="https://www.ut.com.sv/reportes?p_auth=e5aOMQez&amp;p_p_id=MenuReportesEstadisticos_WAR_CompletePublicReports&amp;p_p_lifecycle=1&amp;p_p_state=normal&amp;p_p_mode=view&amp;p_p_col_id=column-1&amp;p_p_col_count=1&amp;_MenuReportesEstadisticos_WAR_CompletePublicReports_reportName=25cargosdelsistema" rel="nofollow noreferrer">DatePicker</a> :</p>
  <p>So far, I have been able to select today's date only. But I don't know how to select a specific date. From this I need to select yesterday's date. Here what I've done so far:</p>
  <pre><code>from selenium import webdriver
  from selenium.webdriver.support.ui import Select
  from selenium.webdriver.common.by import By
  
  driver = webdriver.Chrome(chromedriver)
  driver.get('https://www.ut.com.sv/reportes?p_auth=vUIS4sqn&amp;p_p_id=MenuReportesEstadisticos_WAR_CompletePublicReports&amp;p_p_lifecycle=1&amp;p_p_state=normal&amp;p_p_mode=view&amp;p_p_col_id=column-1&amp;p_p_col_count=1&amp;_MenuReportesEstadisticos_WAR_CompletePublicReports_reportName=25cargosdelsistema')
  
  elm = driver.find_element_by_link_text('Cargos del Sistema')
  driver.implicitly_wait(5)
  elm.click()
  
  #TIPO
  drpmedicion=driver.find_element_by_id('tipo')
  drpmed=Select(drpmedicion)
  driver.implicitly_wait(2)
  
  drpmed.select_by_visible_text('Indicativo')
  driver.implicitly_wait(2)
  
  #SALIDA
  drpsalida=driver.find_element_by_id('outType')
  drpsal=Select(drpsalida)
  driver.implicitly_wait(2)
  drpsal.select_by_visible_text('csv')
  
  #FECHAS INICIO
  date1=driver.find_element(By.NAME,'fecha_desde')
  date1.click()
  driver.implicitly_wait(2)
  date1.click()
  driver.implicitly_wait(2)
  
  date2=driver.find_element(By.CLASS_NAME,'picker__button--today')
  date2.click()
  
  driver.implicitly_wait(5)
  
  #FECHAS FIN
  date3=driver.find_element(By.NAME,'fecha_hasta')
  driver.implicitly_wait(2)
  date3.click()
  driver.implicitly_wait(2)
  date3.click()
  
  driver.implicitly_wait(5)
  
  date4=driver.find_elements(By.CLASS_NAME,'picker__button--today')
  date4[1].click()
  
  driver.implicitly_wait(5)
  
  
  #CLICK FINAL
  btn=driver.find_element(By.XPATH, '//*[@id=&quot;portlet_FormularioReportesEstadisticos_WAR_CompletePublicReports&quot;]/div/div/div/input')
  btn.click()
  </code></pre>