-1

I am trying to click on size from drop down from this particular website, but I'm not able to do that.

size = wait.until(EC.invisibility_of_element_located((By.TAG_NAME, 'UK 6'))).click();
  • 2
    Please share which code you have tried and which exception you have got. If you do not found any error, then please share steps that you follows. – Sagar007 Mar 14 '18 at 5:31
1
  1. Here, the elements of the list don't have any tag name "UK 6". Rather it's a text inside <li> tag.

enter image description here

You can find the element by searching on whether the element contains text "UK 6". The XPATH for finding the element would be:

//li[contains(.,'UK 6')]
  1. Another mistake you have done is you are waiting for the element with invisibility_of_element_located. That means you are waiting for the element to be invisible. It should be visibility_of_element_located according to your need I think.

So the code would be:

wait.until(EC.visibility_of_element_located((By.XPATH, '//li[contains(.,'UK 6')]'))).click()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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