title: Difficulty Scraping Numerical Values from two divs with the same class
body: <p>I am new to web scraping and I am having an issue where I want to grab the &quot;rank&quot; and &quot;Item No.&quot; from this url.  My ultimate goal here is to save this info in a csv and be able to plot the data.  The issue I have now is that these two values are placed in two different divs with the same class name, &quot;item_stat&quot;.</p>
  <pre><code> &lt;div class=&quot;item_stats&quot;&gt;
      &lt;div class=&quot;item_stat&quot;&gt;
            rank
           &lt;span&gt;
            1
           &lt;/span&gt;
      &lt;/div&gt;
      &lt;div class=&quot;item_stat&quot;&gt;
            item no.
           &lt;span&gt;
            #3251
           &lt;/span&gt;
       &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
  <p>I am using the following code to grab the &quot;rank&quot; value.</p>
  <pre><code>page = requests.get(URL)
  soup = bs(page.content, 'html.parser')
  soup2 = bs(soup.prettify(), &quot;html.parser&quot;)
  lists = soup2.find('div', class_=&quot;featured_item&quot;)
  stats = lists.find('div', class_=&quot;item_stats&quot;)
  stats_val = lists.find('div', class_=&quot;item_stat&quot;)
  rank = stats_val.text.replace('&lt;', '')
  rank_val = re.findall(r'\d+', rank)
  </code></pre>
  <p>Output:</p>
  <pre><code>   ['1']
  </code></pre>
  <p>I think I want this value as a float, and I also do not know how to find the &quot;Item No.&quot; value.  Using get_text(), and .text.replace() is giving me errors I haven't had with other scraping projects.  I appreciate any advice, thanks.</p>