Skip to content

Instantly share code, notes, and snippets.

@mishudark
Created November 14, 2010 02:05
Show Gist options
  • Save mishudark/675837 to your computer and use it in GitHub Desktop.
Save mishudark/675837 to your computer and use it in GitHub Desktop.
cookie_h = urllib2.HTTPCookieProcessor()
opener = urllib2.build_opener(cookie_h)
urllib2.install_opener(opener)
ua = 'Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.9.0.11)'
ua += ' Gecko/2009061118 Fedora/3.0.11-1.fc10 Firefox/3.0.11'
h = {"User-Agent": ua}
params = urllib.urlencode({"pass": password,"user" :username})
r = urllib2.Request("http://escolares.utm.mx/alumnos.php", headers=h)
f = urllib2.urlopen(r,params)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment