title: How do I get the ElementHandle's class name when using Puppeteer?
body: <p>I'm trying to get an ElementHandle's class name using Puppeteer... is it possible? Am I using the wrong approach? In this jsBin is part of my code, so you can understand what I am trying to achieve.</p>
  
  <pre><code>CriticalCssPlugin.prototype.load = function( page, src ) {
    return page.goto( src, { waitUntil: 'networkidle2' } )
      .then( () =&gt; {
        return page
          .$$( '*' )
          .then( elements =&gt; {
            return Promise.all( elements.map( element =&gt; {
              return element.boundingBox()
            } ) )
              .then( positions =&gt; {
                let visible = positions.filter( ( rect, index ) =&gt; {
                  if ( !rect ) {
                    return rect
                  }
  
                  rect.element = elements[ index ]
  
                  return this.isAnyPartOfElementInViewport( rect, page.viewport() )
                } )
  
                this.getClasses( visible )
              } )
          } )
      } )
  }
  
  CriticalCssPlugin.prototype.getClasses = function( visibles ) {
    Promise.all( visibles.map( visible =&gt; {
      return visible.element.getProperty( '' )
    } ) )
      .then( classes =&gt; {
        console.log(classes);
      } )
  }
  
  CriticalCssPlugin.prototype.isAnyPartOfElementInViewport = function( rect, viewport ) {
    const windowHeight = viewport.height
    const windowWidth = viewport.width
    const vertInView = ( rect.y &lt;= windowHeight ) &amp;&amp; ( ( rect.y + rect.height ) &gt;= 0 )
    const horInView = ( rect.x &lt;= windowWidth ) &amp;&amp; ( ( rect.x + rect.width ) &gt;= 0 )
  
    return ( vertInView &amp;&amp; horInView )
  }
  </code></pre>
  
  <p><a href="https://jsbin.com/kuzejoluji/edit?js,output" rel="noreferrer">https://jsbin.com/kuzejoluji/edit?js,output</a></p>
  
  <p>Thank you :D</p>