How can I select a dropdown element by a part of its name? I want to select an option based on a DB values, but this values don't have the complete name of the dropdown element, is there any way to make selenium look for the option with my database value as a partial text?
modelo = googleSheet.modelo.upper().strip()
select = Select(WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '/html/body/div/div/div/div[1]/form/fieldset[6]/div/ul/fieldset[3]/div/ul/fieldset[3]/div/ul/fieldset/div/ul/li/label'))))
select.select_by_visible_text(modelo)
I the dropdown option I want to select is "Terrano II 2.7 xpto ol", but my data base value is just Terrano II 2.7
Thanks for the help