This is a quick demo of something we'll pick up next, namely grabbing very specific data chunks using the modules we've just learned plus application programming interfaces (APIs).


In [ ]:
from bs4 import BeautifulSoup
import urllib
import requests

In [ ]:
r = requests.get("http://ebird.org/ws1.1/data/obs/geo/recent?lng=-111.83&lat=41.74")

In [ ]:
soup = BeautifulSoup(r.text,'lxml')

In [ ]:
for sighting in soup.find_all('sighting'):
    print sighting.lat.text, sighting.lng.text, sighting.find('sci-name').text