I am working on selenium and python. I am unable to select the radio button. I want to add the values in a list. and iterate and click on the specific radio button.

 def test_search_in_python_org(self):
        driver = self.driver

        driver.find_element_by_xpath("//a[normalize-space()='ROUND TRIP']").click()

enter image description here


selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//a[normalize-space()='ROUND TRIP']"}

1 Answer 1


I don't think you need to iterate through them.

Just target the correct element, your xpath could look like this:


One of the problems with your current xpath is you're trying to find an 'a' element, where the fake radio buttons are actually 'li' elements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.