Last active
December 29, 2015 15:19
-
-
Save kuanyingchou/7689473 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
count = 0 | |
def write_file(text, path): | |
f = open(path, 'w+') | |
f.write(text.encode('utf8')) | |
f.close(); | |
while True: | |
print('sending request'); | |
payload = { | |
'uid': 'kuanying'+str(count)+'@tradeserv.com', | |
'u_name': 'kuanying', | |
'upwd': '1234', | |
'upwd1': '1234', | |
'agree': 'true' | |
} | |
start = time.time() | |
r = requests.post( | |
r'http://www.kizipad.com/complete.php', | |
data=payload) | |
elapsed = time.time() - start | |
print('got %s in %.2f seconds' % (r.status_code, elapsed)) | |
write_file(r.text, 'out.htm') | |
print('done') | |
count += 1 | |
time.sleep(1) | |
# results: | |
# 17:48:41 ken@ken-mba:test_website$ python ./register.py | |
# sending request | |
# got 200 in 0.39 seconds | |
# done | |
# sending request | |
# got 200 in 0.14 seconds | |
# done | |
# sending request | |
# got 200 in 0.20 seconds | |
# done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment