码迷,mamicode.com
首页 > 其他好文 > 详细

WeChall_Training: Programming 1 (Training, Coding)

时间:2016-09-08 23:12:13      阅读:764      评论:0      收藏:0      [点我收藏+]

标签:

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

 

解题:

  先在浏览器获取自己的cookie,再用python写了个自动提交的程序,header加上自己的cookie,运行即可。

 

import urllib.request
import http.cookiejar
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,********************************)
text = urllib.request.urlopen(req).read().decode(utf-8)
print(text)

url2 = url2+text
req = urllib.request.Request(url2,headers = header)
req.add_header(Cookie,********************************)
text = urllib.request.urlopen(req).read().decode(utf-8)
print(text)

 

WeChall_Training: Programming 1 (Training, Coding)

标签:

原文地址:http://www.cnblogs.com/zhurb/p/5854686.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!