title: Retrieve a number from a span tag, using Python requests and Beautiful Soup
body: <p>I'm new to python and html. I am trying to retrieve the number of comments from a page using requests and BeautifulSoup.</p>
  
  <p>In this example I am trying to get the number 226. Here is the code as I can see it when I inspect the page in Chrome:</p>
  
  <pre><code>&lt;a title="Go to the comments page" class="article__comments-counts" href="http://www.theglobeandmail.com/opinion/will-kevin-oleary-be-stopped/article33519766/comments/"&gt;
      &lt;span class="civil-comment-count" data-site-id="globeandmail" data-id="33519766" data-language="en"&gt;
      226
      &lt;/span&gt;
      Comments
  &lt;/a&gt;
  </code></pre>
  
  <p>When I request the text from the URL, I can find the code but there is no content between the span tags, no 226. Here is my code:</p>
  
  <pre><code>import requests, bs4
  
  url = 'http://www.theglobeandmail.com/opinion/will-kevin-oleary-be-stopped/article33519766/'
  r = requests.get()
  soup = bs4.BeautifulSoup(r.text, 'html.parser')
  
  span = soup.find('span', class_='civil-comment-count')
  </code></pre>
  
  <p>It returns this, same as the above but no 226. </p>
  
  <pre><code>&lt;span class="civil-comment-count" data-id="33519766" data-language="en" data-site-id="globeandmail"&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>I'm at a loss as to why the value isn't appearing. Thank you in advance for any assistance.</p>