Skip to content

Instantly share code, notes, and snippets.

@enginespot
Last active December 12, 2015 03:39
Show Gist options
  • Save enginespot/4708683 to your computer and use it in GitHub Desktop.
Save enginespot/4708683 to your computer and use it in GitHub Desktop.
wlan auto login (CMCC)
import re, urllib2
from lxml.html import fromstring, tostring, parse, submit_form
data = urllib2.urlopen("http://www.baidu.com").read()
dom = fromstring(data)
form = dom.forms[0]
form.fields["username"] = ''#phone number
form.fields["password"] = ''#password
result = parse(submit_form(form)).getroot()
print result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment