我懒得写思路了 hhh
#!usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2,urllib
URL = "http://10.0.1.250/a70.htm"
username = '2015117187'
password = '********'
data = r"DDDDD="+username+"&upass="+password+"&R1=0&R2=&R6=0¶=00&0MKKey=123456&v6ip=&hid1=1131&hid2=38540002&cn=1"
#gett = urllib2.urlopen(URL)
req = urllib2.Request(URL)
req.add_header('Host',"10.0.1.250")
req.add_header('User-Agent',"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/6.2.3637.220 Safari/537.36")
req.add_header('Accept',"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",)
req.add_header('Accept-Language',"zh-CN,zh;q=0.8")
req.add_header('Accept-Encoding',"gzip, deflate")
req.add_header('Accept-Type',"application/x-www-form-urlencoded")
req.add_header('Content-Length',"99")
req.add_header('Referer',"http://10.0.1.237/a70.htm")
req.add_header('Cookie',"PHPSESSID=37hfnmarc6d9o8l2naegqdi806")
req.add_header('Connection',"keep-alive")
req.add_header('Upgrade-Insecure-Requests',"1")
req.add_header('Cache-Control','max-age=0')
req.add_header('Origin','http://10.0.1.250')
req.add_header('Referer','http://10.0.1.250/a70.htm')
response = urllib2.urlopen(req,data.encode('utf-8'))
code = response.getcode()
print code