title: Formatting scraped data from a Website (BeautifulSoup)
body: <p>I'm creating a scraper using BeautifulSoup and Requests that scrapes the pages of a site to get match schedule (and result, if available). This is what I have so far:</p>
  
  <pre><code>    def getMatches(self):
          url = 'http://icc-cricket.yahoo.net/match_zone/series/fixtures.php?seriesCode=ENG_WI_2012' # change seriesCode in URL for different series.
          page = requests.get(url)
          page_content = page.content
          soup = BeautifulSoup(page_content)
  
      result = soup.find('div', attrs={'class':'bElementBox'})
      tags = result.findChildren('tr')
  
      for elem in tags:
          x = elem.getText()
          print x
  </code></pre>
  
  <p>And these are the results I get:</p>
  
  <pre><code>Date &amp;amp; Time (GMT)fixture
  Thu, May 17, 2012 10:00 AMEngland&amp;nbsp; vs &amp;nbsp;West Indies
  3rd&amp;nbsp;TESTA full scorecard will be available shortly.Venue: Edgbaston,    BirminghamResult: England won by 5 wickets
  Fri, May 25, 2012 11:00 AMEngland&amp;nbsp; vs &amp;nbsp;West Indies
  2nd&amp;nbsp;TESTClick here for the full scorecardVenue: Trent Bridge, NottinghamResult:     England won by 9 wickets
  Thu, Jun 7, 2012 10:00 AMEngland&amp;nbsp; vs &amp;nbsp;West Indies
  1st&amp;nbsp;TESTClick here for the full scorecardVenue: Lord'sResult: Match Drawn
  Sat, Jun 16, 2012 9:45 AMEngland&amp;nbsp; vs &amp;nbsp;West Indies
  1st&amp;nbsp;ODIClick here for the full scorecardVenue: The Rose Bowl, SouthamptonResult:     England won by 114 runs (D/L Method)
  Tue, Jun 19, 2012 9:45 AMEngland&amp;nbsp; vs &amp;nbsp;West Indies
  2nd&amp;nbsp;ODIVenue: KIA Oval
  Fri, Jun 22, 2012 9:45 AMEngland&amp;nbsp; vs &amp;nbsp;West Indies
  3rd&amp;nbsp;ODIVenue: Headingley Carnegie
  Sun, Jun 24, 2012 12:00 AMEngland&amp;nbsp; vs &amp;nbsp;West Indies
  1st&amp;nbsp;T20Venue: Trent Bridge, Nottingham
  </code></pre>
  
  <p>Now, I want to classify the data in some structured format. A list of dicts, each containing<br>
  information about a single match would be ideal. But I'm stuck on how to achieve that. The output strings in the result have characters like <code>&amp;nbsp</code>, and the time is weirdly arrange like <code>AMEngland</code>. There's also the matter that If I split the string using the space character as delimiter, countries like West Indies, with 2 words, will be split, and there won't be any uniform way to parse that. </p>
  
  <p>So is there a way I can uniformly parse this data, so I can get in the form. Kinda like: </p>
  
  <pre><code>[ {'date': match_date, 'home_team': team1, 'away_team': team2, 'venue': venue},{ same for match 2}, { match 3 }...]
  </code></pre>
  
  <p>I'll appreciate any help. :)</p>