Created
March 20, 2011 21:54
-
-
Save samstarling/878714 to your computer and use it in GitHub Desktop.
Renew books at Manchester University Library.
This file contains hidden or 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
import re | |
import mechanize | |
LIBRARY_CARD_NO = '12345678' | |
PIN_NO = '0000' | |
br = mechanize.Browser() | |
br.open("http://catalogue.library.manchester.ac.uk/") | |
br.follow_link(text="My Account", nr=1) | |
br.select_form(nr=1) | |
br['barcode'] = LIBRARY_CARD_NO | |
br['pin'] = PIN_NO | |
response = br.submit() | |
try: | |
br.select_form(nr=2) | |
br.submit(label='Renew all') | |
except Exception, e: | |
print e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome work - planning to replicate this for the British Library of Economics and Politics Science (at LSE)!