title: extract data from website using python
body: <p>I recently started learning python and one of the first projects I did was to scrap updates from my son's classroom web page and send me notifications that they updated the site.  This turned out to be an easy project so I wanted to expand on this and create a script that would automatically check if any of our lotto numbers hit. Unfortunately I haven't been able to figure out how to get the data from the website. Here is one of my attempts from last night.</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import urllib.request
  
  webpage = "http://www.masslottery.com/games/lottery/large-winningnumbers.html"
  
  websource = urllib.request.urlopen(webpage)
  soup = BeautifulSoup(websource.read(), "html.parser")
  
  span = soup.find("span", {"id": "winning_num_0"})
  print (span)
  
  Output is here...
  &lt;span id="winning_num_0"&gt;&lt;/span&gt; 
  </code></pre>
  
  <p>The output listed above is also what I see if I "view source" with a web browser.  When I "inspect Element" with the web browser I can see the winning numbers in the inspect element panel.  Unfortunately I'm not even sure how/where the web browser is getting the data. is it loading from another page or a script in the background? I thought the following tutorial was going to help me but I wasn't able to get the data using similar commands. </p>
  
  <p><a href="http://zevross.com/blog/2014/05/16/using-the-python-library-beautifulsoup-to-extract-data-from-a-webpage-applied-to-world-cup-rankings/" rel="nofollow">http://zevross.com/blog/2014/05/16/using-the-python-library-beautifulsoup-to-extract-data-from-a-webpage-applied-to-world-cup-rankings/</a></p>
  
  <p>Any help is appreciated.
  Thanks</p>