title: scraping text with cheerio
body: <p>I am trying to scrape just <code>Jung Ho Kang</code> and <code>5</code> from this html and put it into an object. I want to exclude everything in the <code>(R)</code> and the <code>SS</code>.</p>
  
  <pre><code>&lt;td id="lineup-table-top"&gt;
    &lt;b class="text-muted pad-left-10"&gt;5&lt;/b&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;Jung Ho Kang 
    &lt;small class="text-muted"&gt;(R)&lt;/small&gt; 
    &lt;small class="text-muted"&gt;SS&lt;/small&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>var someObjArr = [];
  
  $('td#lineup-table-top').each(function(i, element){
  
      //Get the text from cheerio.
      var text = $(this).text();
  
      //if undefined, create the object inside of our array.
      if(someObjArr[i] == undefined){
  
          someObjArr[i] = {};
      };
  
      //Update the salary property of our object with the text value.
      someObjArr[i].name = text;
  
      $('b.pad-left-10').each(function(i, element){
  
          //Get the text from cheerio.
          var text = $(this).text();
  
          //if undefined, create the object inside of our array.
          if(someObjArr[i] == undefined){
  
              someObjArr[i] = {};
          };
  
          //Update the name property of our object with the text value.
          someObjArr[i].batting = text;
      });
  });
  </code></pre>
  
  <p>The exact output from the code is as follows:</p>
  
  <pre><code>{ batting: '5',
    name: '5   Jung Ho Kang (R) SS 3B' }
  { name: '5   Jung Ho Kang (R) SS' },
  </code></pre>
  
  <p>The Expected output:</p>
  
  <pre><code>{ batting: '5',
    name: 'Jung Ho Kang' }
  </code></pre>
  
  <p>I don't know why it appears to be looping twice and I can't figure out how to isolate just the name without it having a class/id associated with it.</p>
  
  <p>Any direction is enthusiastically appreciated.</p>