题目:
When you visit this link you receive a message.
Submit the same message back to http://www.wechall.net/challenge/training/programming1/index.php?answer=the_message
Your timelimit is 1.337 seconds
解题:
时间限制为1.337 ,于是写python脚本实现自动提交。
先从浏览器获取自己的cookie,执行脚本,过关。
python 3.6.1 下载地址:https://www.python.org/getit/
(以下代码只适合python3.0及以上版本)
import urllib.request
import http.cookiejar
import webbrowser
url1='http://www.wechall.net/challenge/training/programming1/index.php?action=request'
url2='http://www.wechall.net/challenge/training/programming1/index.php?answer='
header={}
req =urllib.request.Request(url1,headers=header)
req.add_header('cookie','your cookie')
text=urllib.request.urlopen(req).read().decode('utf-8')
print(text)
url2=url2+text
webbrowser.open(url2)