Skip to content

Instantly share code, notes, and snippets.

@mseiwald
Created February 8, 2012 21:40
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 mseiwald/1774101 to your computer and use it in GitHub Desktop.
Save mseiwald/1774101 to your computer and use it in GitHub Desktop.
import mechanize
br = mechanize.Browser()
br.open('https://levis.fh-ooe.at/Schedule/MySchedule.aspx')
br.select_form(name='aspnetForm')
br['ctl00$loginContent$tbUsername'] = 's1110304016'
br['ctl00$loginContent$tbPassword'] = 'PASSWORD'
br['ctl00$loginContent$ddlDomain'] = ['Hagenberg']
br.submit()
br.select_form(name='aspnetForm')
br['ctl00$ctl00$ctl00$MainArea$MainArea$ContentArea$ddlSemester'] = ['SS12']
r = br.submit(name = 'ctl00$ctl00$ctl00$MainArea$MainArea$ContentArea$btnExportICalendar')
ics = r.read()
open('stundenplan.ics', 'w').write(ics)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment