Isn't it annoying not to know when a new payslip arrives? Well, it annoys me. So I fixed it.
By defining a cron job that will run this script, you will be able to watch Hilan for new payslips
- Notifications on Mac for new payslips in Hilan
Step 1: Create virtual environment and install requirements
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r pip_requirements.txt
Step 2: Add your credentials
$ nano creds.json
Your credentials need to be in that file in the following format:
{
"username": "<hilan_username>",
"password": "<hilan_password"
}
Step 3: Selenium requires a driver to interface with the chosen browser.
For Click for Chrome For Click for FireFox For Click for safari
Step 4: Extract the downloaded driver onto a folder
Step 5: Set path variable to the environment. Paste this command to the terminal
$ export PATH=$PATH:/home/path/to/the/driver/folder/
Step 6: Add the cron job
crontab -e
In the editor enter the following line (replace the path to the repo with your own):
*/15 * * * * cd <path_to_repo> ; /usr/bin/env venv/bin/python hilan.py