I am not able to find or access any element on the following webpage
I am trying to download the file by accessing the download icon but I am not able to do that. I am getting 'No element found' error or 'Timeout exception' if I am waiting until the element is found.
There is no iframe present. Can anyone help me here to download the file using python selenium ?
I have written following script ... need help
from selenium import webdriver
import os.path # to get Employee ID
import time
from selenium.webdriver.chrome.options import Options # to change the download location
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
# Get the Employee ID
EmplyID = os.getenv('USER', os.getenv('USERNAME', 'user'))
# Get the final download location
DownloadPath = (f'C:\\Users\\{EmplyID}\\Desktop\\Catalog files\\Downloaded Files')
chromeOptions = Options()
chromeOptions.add_experimental_option("prefs", {"download.default_directory": DownloadPath})
# create a driver object
driver = webdriver.Chrome(executable_path=f'C:\\Users\\{EmplyID}\\Desktop\\Catalog files\\chromedriver.exe',options=chromeOptions)
# open the pdf
driver.get("https://www.eaton.com/content/dam/eaton/products/conduit-cable-and-wire-management/crouse-hinds/catalog-pages/crouse-hinds-locknuts-nipples-washers-reducers-plugs-rigid-catalog-page.pdf")
driver.maximize_window()
time.sleep(10)
# creating for explicit wait
wait = WebDriverWait(driver,15)
element = wait.until(EC.presence_of_element_located((By.ID, 'download')))
element.click()
time.sleep(5)