当前适用于旧式路由器,高安全性的和智能路由器可通过phantomjs实现
TP-Link
#-*-coding:utf-8-*-
import requests
import base64
params = {
"ssid1":"test_auto",
"wlMode":2,
"channel":2,
"mode":5,
"chanWidth":1,
"broadcast":2,
"brlssid":"",
"brlbssid":"",
"detctwds":1,
"keytype":1,
"wepindex":1,
"keytext":"",
"Save":"%B1%A3+%B4%E6"
}
Header = {
"Host":"10.10.31.245",
"User-Agent":"Mozilla/5.0 (Windows NT 6.1; rv:48.0) Gecko/20100101 Firefox/48.0",
"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language":"zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
"Referer":"http://10.10.31.245/userRpm/WlanNetworkRpm.htm",
"Cookie":"Authorization=Basic%20YWRtaW46cGFzc3dvcmQ%3D",
"Connection":"keep-alive"
}
#
# r = requests.get(url='http://10.10.31.245/userRpm/WlanNetworkRpm.htm',headers=Header, params=params) #带参数的GET请求
# print(r.url)
password = 'password'
print base64.b64encode('admin:'+password)
print base64.b64decode('YWRtaW46')
网友评论