This is my code and it only opens chrome.Does not click on button id that i gave.CAn anyone please help me with this.
import os
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
os.environ['PATH'] += r"C:/SeleniumDriver"
driver = webdriver.Chrome()
WebDriverWait(driver, 10)
driver.get("https://jqueryui.com/progressbar/#download")
my_element = driver.find_element(By.ID, 'downloadButton')
my_element.click()
The button is inside of an iframe
, in which case you have first switch to the iframe
and then access the element inside of it.
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH, "//iframe")))
driver.find_element(By.ID, "downloadButton").click()
imports:
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC