title: Best way to check if text exist or not in the page using Selenium- Python
body: <p>I'm new to writing a test which verifies if text exists on a webpage in Python. I want to verify the words 'heading of the page' exist but my issue is there isn't any xpath or css selector. I've seen examples of people using those to find text on a particular page but my page doesn't have that for the words i'm searching for.</p>
  <p>I want to verify the texts exists and then throw an exception if needed. Below is the stack trace of the google inspect of the text i want to verify and the code i've written so far but need help on structuring it correctly and how to find the text correctly.</p>
  <p>Stack trace</p>
  <pre><code>&lt;div style=&quot;width:161.75mm;min-width: 161.75mm;&quot;&gt;heading of the page&lt;/div&gt;
  </code></pre>
  <p>Below is the code i've started but it's failing with AssertionError</p>
  <pre><code>src = driver.page_source
  text_found = re.search(r'heading of the page', src)
  assert element.text == 'heading of the page'
  </code></pre>