title: Property 'innerText' does not exist on type 'Element'
body: <p>I'm using Typescript for Puppeteer. I'm trying to get innerText from an element.</p>
  
  <pre><code>const data = await page.$eval(selector, node =&gt; node.innerText);
  </code></pre>
  
  <p>I'm getting the error:</p>
  
  <blockquote>
    <p>Property 'innerText' does not exist on type 'Element'</p>
  </blockquote>
  
  <p>I tried casting to HTMLElement like described in this question:
  <a href="https://stackoverflow.com/questions/54886637/error-property-innertext-does-not-exist-on-type-eventtarget">error &quot; Property &#39;innerText&#39; does not exist on type &#39;EventTarget&#39; &quot;?</a></p>
  
  <pre><code>const data = await page.$eval(selector, &lt;HTMLElement&gt;(node: HTMLElement) =&gt; node.innerText);
  </code></pre>
  
  <p>As well as creating my own Interface like this:</p>
  
  <pre><code>interface TextElement extends Element {
      innerText: string;
  }
  </code></pre>
  
  <p>But in each case I'm getting the error that innerText does not exist on this particular type.</p>
  
  <blockquote>
    <p>Property 'innerText' does not exist on type 'HTMLElement'</p>
  </blockquote>
  
  <p>Why is this happening and how to deal with this?</p>