Selecting options using Selenium and Python

To select the select-options with text as CSV from the html-select tag using Selenium you need to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following Locator Strategies: Using CSS_SELECTOR: select = Select(WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, “select.Select[name=”Format”]”)))) select.select_by_visible_text(“CSV”) Using XPATH: select = Select(WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, “//select[@class=”Select” and @name=”Format”]”)))) select.select_by_visible_text(“CSV”) Note : You have to … Read more