Skip to content

Commit

Permalink
查询结果写入文件
Browse files Browse the repository at this point in the history
  • Loading branch information
Editorkn committed Nov 27, 2015
1 parent 186c6ac commit 8fb6015
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions fuck_hit_wlan.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# 估计HIT和REFER等192.168.108.13需要进行调整
# 注意:茶水不好喝

import urllib, urllib2, cookielib
import urllib, urllib2, cookielib, io

school_list = []

Expand Down Expand Up @@ -60,6 +60,10 @@ def post3(usrname, pwd):
response = u.read().decode('utf-8').encode('gbk')
if 'login_ok' == response:
print usrname, pwd, response

fileHandle = open("hit_wlan.account","a")
fileHandle.write(usrname+'\n')
fileHandle.close()

body = {
'action': 'logout',
Expand Down Expand Up @@ -94,7 +98,13 @@ def main():
p = '0'+str(person)
else:
p = str(person)
post3('1'+str(i)+str(school)+'0'+str(clas)+p, '1234')

fileHandle = open("hit_wlan.account",'r')
fileData = fileHandle.read()
fileHandle.close()
usrname = '1'+str(i)+str(school)+'0'+str(clas)+p
if usrname not in fileData:
post3(usrname, '1234')

print "查找完毕,享受去吧~~"

Expand Down

0 comments on commit 8fb6015

Please sign in to comment.