Retrieve ID of any element using webdriver in python given value of the element
<p>I am using selenium to record testcases in firefox. It records a button click/or any action for that  matter like below,</p>

<pre><code>driver = self.driver
driver.get(self.base_url + "/")
driver.find_element_by_id("ctl00__mainContent_lnkforgotpassword").click()
driver.find_element_by_id("ctl00__mainContent_ucForgotPassword1_btnNext").click()
</code></pre>

<p>Here the driver makes use of the find_element_by_id method to access the element and it works great.</p>

<p>But my requirement is to find this Id given just the text of that element,
like -</p>

<p>If <strong>Forgot Password</strong> is a link and I want to retrieve the <strong>ID</strong> of this link,
I would modify the about code as,</p>

<pre><code>driver.find_element_by_id(getID("Forgot Password")).click().
</code></pre>

<p>So is there a way to write <strong>getId()</strong> function so as to retrieve the <strong>ID</strong> of the link <strong>Forgot Password</strong> <em>(Or Id of some Label/Button in other cases)</em> from the current open page?</p>