title: How to read the value of an span element with Puppeteer
body: <p>I am trying to do some web scraping reading some lines inside a html page. I need to look for a text which is repeated through the page inside some <code>&lt;span&gt;</code> elements. In the following example I would like to end with an array of strings with ['Text number 1','Text number 2','Text number 3']</p>
  
  <pre><code>&lt;html&gt;
      ...
      &lt;span&gt;Text number 1&lt;/span&gt;
      ...  
      &lt;span&gt;Text number 2&lt;/span&gt;
      ...
      &lt;span&gt;Text number 3&lt;/span&gt;
      ...
  &lt;/html&gt;
  </code></pre>
  
  <p>I have the following code</p>
  
  <pre><code>sElements = ' ... span'; // I declare the selector.
  cs = await page.$$(sElements); // I get an array of ElementHandle
  </code></pre>
  
  <p>The selector is working as in Google Chrome developer tools it captures exactly the 3 elements I am looking for. Also the cs variable is filled with an array of three elements. But then I am trying</p>
  
  <pre><code>for(c in cs)
      console.log(c.innerText);
  </code></pre>
  
  <p>But undefined is logged. I have tried with .text .value .innerText .innerHTML .textContent ... I do not know what I am missing as I think this is really simple</p>
  
  <p>I have also tried this with the same undefined result.</p>
  
  <pre><code>cs = await page.$$eval(sElements, e =&gt; e.innerHTML);
  </code></pre>