title: Scraping Node.js: Getting text from H2 header
body: <p>Ok so for fun I decided to scrape all the users who go to my college who are signed up on the website moodle.</p>
  
  <p>This is the program I made with Node.js and cheerio that scrapes the site, but I can not seem to get the text that is inside the H2 tag.</p>
  
  <p>This is the website I am scraping from, <a href="http://moodle.ramapo.edu/user/profile.php?id=2101" rel="nofollow">http://moodle.ramapo.edu/user/profile.php?id=2101</a> 
  All I need to do is just change the ID number and it loops through every student.</p>
  
  <pre><code>     var request = require('request'),
       cheerio = require('cheerio');
       urls = [];
  
       //For just single page, eventually will loop through each page.
       request('http://moodle.ramapo.edu/user/profile.php?id=2101', function(err, resp, body){
       if (!err &amp;&amp; resp.statusCode == 200) {
            var $ = cheerio.load(body);
            $('h2.main', '#yui_3_9_1_2_1410303448188_167').each(function(){
                //Not sure how to retrieve just the text name of person
            });
        console.log(urls);
        };
   });
  </code></pre>
  
  <p>How do I just select the text inside the H2 tag so that I can log all of them to my console?</p>