title: I need to find the value in a dynamic h1 element in selenium python
body: <p>I am using python 2.7, Firefox and selenium 3.11</p>
  <p>I have the following line with a dynamic number as id:</p>
  <pre><code>&lt;div class=&quot;class1&quot; dojoattachpoint=&quot;titleText&quot; dojoattachevent=&quot;onmouseover:_mouseOverTitle,onmouseout:_mouseOutTitle,onmousedown:_mouseDownTitle&quot;&gt;
  &lt;h1 id=&quot;_N90399546_title&quot;&gt;‪textToFind&lt;/h1&gt;
  </code></pre>
  
  <p>I want to locate textToFind.</p>
  <p>I have tried the following:</p>
  <ol>
  <li><p><code>x= driver.find_element_by_xpath(&quot;//h1[@id='dynamicNumber']&quot;)</code> -&gt; which I was trying when the dynamic number was the same, to see if it worked, but didn't...</p>
  <p>Result: textToFind not found</p>
  </li>
  <li><p><code>x= driver.find_element_by_link_text('textToFind')</code> -&gt; didn't work in a dynamic search</p>
  <p>Result: textToFind not found</p>
  </li>
  <li><p><code>x = driver.find_element_by_xpath(&quot;//*[@class='class1'][contains(text(),'textToFind')]&quot;)</code></p>
  <p>Result: textToFind not found</p>
  </li>
  <li><p><code>x = driver.find_element_by_xpath(&quot;//*[@class='class1'][contains(text(),'textToFind')]&quot;).getAttribute(&quot;innerHTML&quot;)</code></p>
  <p>Result: textToFind not found</p>
  </li>
  <li><p><code>x = driver.find_element_by_xpath(&quot;//*[@class='class1']&quot;)</code></p>
  <p>Result: textToFind not found</p>
  </li>
  </ol>
  <p>I don't need to extract the text, get attributes, or anything, I just need to find the &quot;textToFind&quot; string. I really appreciate the help.</p>
  <p>I have had search several selenium dynamic tutorials, look dozens of websites, search several similar posts in stackoverflow and I can't get to find the text I need.</p>