Why can't I find an input element with a placeholder in selenium?

Viewed 19264

In a webpage I have the following element:

<input placeholder="Search in your collabs" class="md-input" type="text">

which I try to select by the following piece of code (in python):

elem = browser.find_element_by_xpath("//input[@placeholder='Search in your collabs']")

but when running the code I get the following error:

NoSuchElementException: Message: Unable to locate element: //input[@placeholder='Search in your collabs']

The element I am looking for is inside an iframe which I selected before correctly (I did another find_element_by_xpath before that with some other attributes). In detail, what I did before was:

browser.switch_to_frame(browser.find_element_by_id("clb-iframe-workspace"));

So but why is this not working now?

1 Answers
Related