This tool uses Selenium and Python to download the latest payslip from ADDISON OneClick.
It works by using starting a Google Chrome instance through Selenium and automatically navigating through the page to find the last payslip.
- In properties.ini, provide login credentials and output directory.
- Run
python downloader.py
from a command line or terminal. - The script downloads the latest payslip for the last month and copies it into the configured output directory.
You can configure the script using the properties.ini file. The following properties are supported
category | property name | type | required | default | description |
---|---|---|---|---|---|
login |
url |
string | yes | - | The URL to ADDISON OneClick |
login |
client_number |
string | yes | - | The client number for the login form |
login |
username |
string | yes | - | The username for the login form |
login |
password |
string | yes | - | The password for the login form |
file |
rename |
bool | no | True | The script can rename the downloaded payslip file. See file.file_destination for details. |
file |
search_period |
string | yes | '7' | There are two filter options available. The script will download all available documents within the filter period. By default, all documents from the last 7 days are downloaded. Available options:
|
file |
file_destination |
string | yes | - | The script can parse the original file name and use the encoded information to format the file following a user-defined pattern. To define a pattern, use placeholders and format codes A placeholder needs to be surrounded by curly brackets ( {} ) and directly followed by a set of format codes.You can use the following placeholders:
~output/2023/09/09 September (20231005).pdf (depending on the original file):file_destination = ~/output/{accounting_period%Y}/{accounting_period%m} {accounting_period%B} ({create_date%Y%m%d}).pdf |
settings |
wait_timeout |
int | no | 10 | Amount of seconds to wait for a web component to render |
settings |
download_timeout |
int | no | 10 | Amount of seconds to wait for the download to finish. |
settings |
headless |
bool | no | True | When set to True the browser used to automate the download is hidden. Setting this to False will show all browser interaction. |
debug |
dry_run |
bool | no | False | Set this to True if you want to run the script right up to the download page but skip the actual download |
debug |
logging_enabled |
bool | no | True | When enabled, log output from the script will be written to the logs folder |
debug |
log_level |
string | no | INFO | Set the log level the scripts logger. Valid options are:
|
debug |
selenium_logging_enabled |
bool | no | False | When enabled, log output from Selenium will be written to the logs folder |
debug |
selenium_log_level |
string | no | DEBUG | Set the log level the selenium logger. Valid options are:
|
debug |
log_folder |
string | no | logs | The output folder for log files |
[login]
url = https://url-to-one-click.com
client_number = 42
username = MyUser
password = MyPassword
[file]
file_destination = ~/output/{accounting_period%Y}/{accounting_period%m} {accounting_period%B} ({create_date%Y%m%d}).pdf