title: puppeteer howto get element tagName
body: <p>I would like to get an element's tagName. Should be <code>button</code> in following example.</p>
  
  <pre><code>const puppeteer = require('puppeteer')
  
  async function run () {
    const browser = await puppeteer.launch({headless: false})
    const page = await browser.newPage()
    const html = `
      &lt;div&gt;
      &lt;button type="button"&gt;click me&lt;/button&gt;
      &lt;span&gt;Some words.&lt;/span&gt;
      &lt;/div&gt;
    `
    await page.setContent(html)
    const elements = await page.$$('button')
    const tagName = await elements[0].$eval('*', node =&gt; node.tagName)
    console.log(tagName) // expect to be 'button'
    await browser.close()
  }
  
  run()
  </code></pre>
  
  <p>The error message said <code>Error: failed to find element matching selector "*"</code></p>
  
  <p>I can tell <code>elements</code> matched one element as <code>elements.length</code> is <code>1</code></p>
  
  <p>Where is wrong?</p>
  
  <p>========== Edit ==========</p>
  
  <p>Let's say I already had <code>elements</code> beforehand, how to get the <code>tagName</code> out of it.</p>
  
  <p>Thanks!</p>