Created
May 29, 2015 04:00
-
-
Save mimaun/637346ebea9a6857fe11 to your computer and use it in GitHub Desktop.
WeChall Programming1(Timed out)
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
# -*- coding: utf-8 -*- | |
import mechanize | |
br = mechanize.Browser() | |
br.set_handle_robots(False) | |
# 仮想ブラウザが開いてログインページを読み込む. | |
br.open("http://www.wechall.net/login") | |
# 一番初めの入力フォームを選択. | |
br.select_form(nr = 0) | |
br['username'] = '自分のID' | |
br['password'] = 'パスワード' | |
# ログインボタンを押す. | |
br.submit() | |
br.open("http://www.wechall.net/challenge/training/programming1/index.php?action=request") | |
# response = br.response() | |
key = br.response().read() | |
br.open("http://www.wechall.net/challenge/training/programming1/index.php?answer=" + key) | |
# response = br.response() | |
print br.response().read() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment