Emre Özel
Emre Özel

Reputation: 9

Can't refer to the element

I am working on a automation application with python and selenium.But ı got stucked clicking on the "I don't have a phone number seciton. To understand my problem better please look at the image that i have uploaded

I have tried the following codes (One for class name and one for Xpath)but nothing worked properly:

driver.find_element_by_xpath('''//*["I don't have mobile phone"]''').click()


driver.find_element_by_class_name('toggle-link link_has-no-phone').click()

Could you please help me?

Thanks,

Upvotes: 0

Views: 34

Answers (1)

octopus
octopus

Reputation: 169

Try these steps :

  1. wait for the element to load and become visible
  2. make sure the xpath is correct or right-click on the element in inspect mode and click on copy as Xpath

    3 - make sure there's only one element with that path and it's clickable

Upvotes: 1

Related Questions