Skip to content

Instantly share code, notes, and snippets.

@samstarling
Created March 20, 2011 21:54
Show Gist options
  • Save samstarling/878714 to your computer and use it in GitHub Desktop.
Save samstarling/878714 to your computer and use it in GitHub Desktop.
Renew books at Manchester University Library.
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
@timrogers
Copy link

Awesome work - planning to replicate this for the British Library of Economics and Politics Science (at LSE)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment