Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97986

Download a file procedure in python better than Selenium

$
0
0

I'm trying to download a file result from this site:

https://www.coordinador.cl/operacion/documentos/registro-de-instrucciones-de-operacion-rio-sscc-energia/

And for that i use Selenium for select dates and click Download (if i wget the link get 403 error, it looks like the download link redirect to AWS S3, so i can't just use wget)

Is there a better way to do this? (i don't have experience with AWS, so i don't know how to deal with that)

My code:

from selenium import webdriverfrom selenium.webdriver.common.by import Byimport timedriver = webdriver.Chrome()driver.get('https://www.coordinador.cl/operacion/documentos/registro-de-instrucciones-de-operacion-rio-sscc-energia/')fini=driver.find_element(by='id',value='energia-inicio')fini.click()cal_ini=driver.find_element(By.CSS_SELECTOR,value='a.ui-state-default.ui-state-highlight')cal_ini.click()fini=driver.find_element(by='id',value='energia-termino')fini.click()cal_fin=driver.find_element(By.CSS_SELECTOR,value='a.ui-state-default.ui-state-highlight')cal_fin.click()downloadcsv=driver.find_element(By.CSS_SELECTOR,value='a.cen_btn.cen_btn-primary.download-energia')downloadcsv.click()time.sleep(30)driver.close()

Viewing all articles
Browse latest Browse all 97986

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>