Skip to content

Instantly share code, notes, and snippets.

@mimaun
Created May 29, 2015 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mimaun/637346ebea9a6857fe11 to your computer and use it in GitHub Desktop.
Save mimaun/637346ebea9a6857fe11 to your computer and use it in GitHub Desktop.
WeChall Programming1(Timed out)
# -*- 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