Skip to content

Instantly share code, notes, and snippets.

@studiawan
Created December 16, 2013 05:09
Show Gist options
  • Save studiawan/7982585 to your computer and use it in GitHub Desktop.
Save studiawan/7982585 to your computer and use it in GitHub Desktop.
HTTP client using urllib2 & beautifulsoup parser
# get short tutorial here: http://www.pythonforbeginners.com/python-on-the-web/beautifulsoup-4-python/
import urllib2
from bs4 import BeautifulSoup
response = urllib2.urlopen('http://www.studiawan.com').read()
soup = BeautifulSoup(response)
print soup.title.string
print soup.get_text()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment