title: Puppeteer - Search for element by div class - Return all div classes for Element
body: <p>I have a site I need to scrape, to find a list of classes on a div, by searching for a particular div class.</p>
  
  <p>For instance, if we have the code:</p>
  
  <pre><code>//HTML on site
  &lt;div class="main"&gt;Main Stuff&lt;/div&gt;
  &lt;div class="class1 class 2 specialclass"&gt;Other Stuff&lt;/div&gt;
  &lt;div class="footer"&gt;Footer Stuff&lt;/div&gt;'
  </code></pre>
  
  <p>I need to search for "special class" as a div class, and return the list of classes for that div, so I would want to return:
  <code>class1 class2 specialclass</code></p>
  
  <p>I'm using a Wikibooks site as an example and running this code:</p>
  
  <pre><code>//Puppeteer Code
  const puppeteer = require('puppeteer')
  const devices = require('puppeteer/DeviceDescriptors');
  
  const browser = await puppeteer.launch();
  
  const page = await browser.newPage();
  await page.goto('https://www.wikibooks.org/');
  
  const myclassname = await page.evaluate(() =&gt; 
  document.querySelector('.lang1').innerText);
  
  console.log(myclassname);
  </code></pre>
  
  <p>It searches for the div with a class of <code>lang1</code>, the default language div near the top of the screen, and returns me the text of the object, but I don't know what to change <code>innerText</code> to in order to get the class names of the object, so it will return <code>central-featured-lang lang1</code>, all of the classes of that object.</p>