title: Check if element is present in header, body or footer selenium python
body: <p>Taking the example of this site:</p>
  
  <p><a href="https://www.imglobal.com" rel="nofollow noreferrer">https://www.imglobal.com</a></p>
  
  <p>The contact number is present in the body of the webiste
  <a href="https://i.stack.imgur.com/dcIIr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dcIIr.png" alt="enter image description here"></a>
  Certain sites have it on top, along with the menu tabs, and certain sites at the bottom footer.</p>
  
  <p>I have developed the routine to locate the element and its position using</p>
  
  <pre><code>    element.location
      element.location_once_scrolled_into_view
  </code></pre>
  
  <p>and to scroll into the view of the element</p>
  
  <pre><code>    browser.execute_script("arguments[0].scrollIntoView()", element)
  </code></pre>
  
  <p>Is there a way to directly interpret if the element is present in the header/body/footer of the webpage, with the help of the tags, with selenium or bs4 in python.?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Header example:
  <a href="https://www.moeck.com/" rel="nofollow noreferrer">https://www.moeck.com/</a></p>
  
  <p>Footer example:
  <a href="https://www.andrew-kelly.co.uk/" rel="nofollow noreferrer">https://www.andrew-kelly.co.uk/</a></p>