Training: Programming 1 (Training, Coding)
题目描述
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
当您访问此链接时,您会收到一条消息。
将相同的消息提交回http:/www.wechall.net/Challation/Training/Programming1/index.php?Answer=the_message。
你的时间限制是1.337秒
解:
考验手速的时候到了,只要手速够快这关就很轻松。。。话不多说,走起。。。
。。。在经历n次失败之后。。。终于,我放弃了。还是老老实实靠程序来实现。
这里我用的是python3
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','WC=11902277-43537-W2ovBL4df44puWJB') #cookie(WC=11902277-43537-W2ovBL4df44puWJB)要用你自己的!!!
text = urllib.request.urlopen(req).read().decode('utf-8')
url2 = url2+text
req = urllib.request.Request(url2,headers = header)
chromePath = r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' #例如我的:C:\***\***\***\***\Google\Chrome\Application\chrome.exe
webbrowser.register('chrome', None, webbrowser.BackgroundBrowser(chromePath)) #这里的'chrome'可以用其它任意名字,如chrome111,这里将想打开的浏览器保存到'chrome'
webbrowser.get('chrome').open(url2)
这里因为我平时用的浏览器与我刷wechall的不一样,如果一样参照下面代码
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','WC=11902277-43537-W2ovBL4df44puWJB') #cookie(WC=11902277-43537-W2ovBL4df44puWJB)要用你自己的!!!
text = urllib.request.urlopen(req).read().decode('utf-8')
url2 = url2+text
req = urllib.request.Request(url2,headers = header)
webbrowser.open(url2)
运行代码即可解题。
wechall相关链接:我的wechall之旅??!