Skip to content

Instantly share code, notes, and snippets.

@nomeyer
Last active March 13, 2016 21:05
Show Gist options
  • Save nomeyer/be3946fa953e1691bc90 to your computer and use it in GitHub Desktop.
Save nomeyer/be3946fa953e1691bc90 to your computer and use it in GitHub Desktop.
Ridiculously simple scraper (out of date)
import urllib2
import BeautifulSoup
request = urllib2.Request("http://www.gpsbasecamp.com/national-parks")
response = urllib2.urlopen(request)
soup = BeautifulSoup.BeautifulSoup(response)
for a in soup.findAll('a'):
if 'national-park' in a['href']:
print 'found a url with national-park in the link'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment