title: Scraping messy source page with Beautiful Soup
body: <p>I try to do some web scraping using Python and Beautiful Soup, but the source page of the webpage is not the prettiest. The code below is a minor part of the source page:</p>
  
  <pre><code>...717301758],"birthdayFriends":2,"lastActiveTimes":{"719317510":0,"719435783":0,...
  </code></pre>
  
  <p>I want to get the parameter '2' after the string 'birthdayFriends', but I have no idea how to get it. So far i have written the code below, but it only prints a empty list.</p>
  
  <pre><code>import urllib2
  from bs4 import BeautifulSoup
  
  # Create an OpenerDirector with support for Basic HTTP Authentication...
  auth_handler = urllib2.HTTPBasicAuthHandler()
  auth_handler.add_password(realm='PDQ Application',
                            uri='myWebpage',
                            user='myUsername',
                            passwd='myPassword')
  opener = urllib2.build_opener(auth_handler)
  # ...and install it globally so it can be used with urlopen.
  urllib2.install_opener(opener)
  page = urllib2.urlopen('myWebpage')
  
  soup = BeautifulSoup(page.read())
  
  bf = soup.findAll('birthdayFriends')
  
  print bf
  
  &gt;&gt; []
  </code></pre>