I am trying to download a file after a login, so far the program enters the url and enters the user data and password, the problem is when I try to download the file of the five available options (I need the last one). The problem is that even if it does not mark any error the program does not download the file. just does nothing.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time
driver = webdriver.Chrome(executable_path=r"C:\Driverchrome\chromedriver.exe")
driver.get("https://earthexplorer.usgs.gov/download/external/options/LANDSAT_8_C1/LC80260472019253LGN00/INVSVC/")
login=driver.find_element_by_xpath("//div[input/@class='button pageButton']")
login.click()
time.sleep(2)
usuario=driver.find_element_by_name("username")
usuario.send_keys("Alex")
contrasena=driver.find_element_by_name("password")
contrasena.send_keys("micontraseña")
contrasena.send_keys(Keys.ENTER)
descargar=driver.find_element_by_partial_link_text("Downl")
descargar.click()
I have tried different ways to call the download button, but none worked for me. the code of the download button is:
<input type="button" class="button inlineButton" title="Download this Product" onclick="window.location='https://earthexplorer.usgs.gov/download/12864/LC80260472019253LGN00/STANDARD/INVSVC'" value="Download">
It is important to say that the other download buttons have a similar code except for the download link