I am trying to select South Africa from the option list below:
<select name="from_country" id="from_country" data-role="none" class="button-negative button-negative-country-select classic" > <option value="ZA">South Africa</option> <option value="ZW" selected="selected">Zimbabwe</option> <option value="BW">Botswana</option> <option value="ZM">Zambia</option> <option value="MW">Malawi</option> </select>
I have tried using xpath like the solotion here :
driver.find_element_by_xpath("//select[@name='from_country']/option[text()='South Africa']").click()
but this results in:
Exception has occurred: NoSuchElementException
I have then assumed that maybe the form is been rendered after the page has finished loading and I applied WebDriverWait:
WebDriverWait(driver,20).until(EC.element_located_to_be_selected((By.XPATH,"//select[@name='from_country']/option[text()='South Africa']"))).click()
and it results in:
Exception has occurred: TimeoutException
If I use Chrome developer tools and search for the element using xpath it shows that the xpath is valid.
The webpage in question: https://www.mukuru.com/sa/send-money-to-nigeria/
click()
for<select>
tags. Check the all the answers within the post you have mentioned within this question.iframe
that is why the problem.