title: How to get text with Selenium WebDriver in Python
body: <p>I'm trying to get text using Selenium WebDriver and here is my code. Please note that I don't want to use XPath, because in my case the ID gets changed on every relaunch of the web page.</p>
  <p>My code:</p>
  <pre><code>text = driver.find_element_by_class_name(&quot;current-stage&quot;).getText(&quot;my text&quot;)
  </code></pre>
  <p>HTML:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;span class=&quot;current-text&quot; id=&quot;yui_3_7_0_4_1389185744113_384&quot;&gt;my text&lt;/span&gt;
  </code></pre>
  <p>How can I fix this?</p>