This is a small python script that enrolls you (a student of ETH) in asvz classes that require registration (all of them as of summer 2020).
The code logs in before the start of the enrollment and then just posts the enrollment request. This should be faster than a pure selenium registration.
Please get in touch if the script is broken or you need help.
- Install Selenium chromedriver or geckodriver for Selenium
- Clone this repo
- Install python requirements
pip -r install requirements.txt
- Save your netz username and password in a file
credentials.json
in the same folder{"username":"your_username", "password":"your_password"}
. Your credentials are only used to login with switch. - (Run test with
python3 test.py
) - Call
asvz\_register.py <lesson_id>
with find course on asvz, copy the lesson id from the url. Example: for https://schalter.asvz.ch/tn/lessons/95699asvz\_register.py 95699
The script will retrieve the enrollment time and wait for it to start before trying the login. The script must be running to enroll so keep it on a server or some other machine that is online until the enrollment starts.
It is easy to say, that you should have done it already with the upper script. But however if you're lucky there is somebody who does unregister and you may get this place.
You just use the script: python3 waitforempty.py <lesson_id>
and then you just hope you get lucky. If there is a free place you will automatically get enrolled.
- Inspired by the code of ChenChen
- The code in this repository is forked and extended from uniquefine