2022-12-12:明天就是行程卡正式下线的日子,疫情封控的时代即将落幕,这个项目也到了归档的时刻了。(2019.12~2022.12)
Environment: [email protected]
Denpendences. Install these python packages:
pip3 install selenium webdriver_manager json smtplib email
Create a user-info.json
in project root directory, the contents in the file like this, and fill in information of user who want to use this script.
{
"users_info": [
{
"username": "u1",
"password": "p1",
"in_campus_status": "True",
"location": ""
},
{
"username": "u2",
"password": "p2",
"in_campus_status": "True",
"location": ""
}
]
}
Tip: Now location
item don't need to be filled in, and you should leave it without any action.
Create a manager_email_info.json
file in root directory of project, and the content in it like this. Replace these information with yours.
{
"from_address": "[email protected]",
"from_address_pwd": "sender_password",
"to_address": "[email protected]"
}
# 1. cd the script dir
# 2. execute this script
/usr/local/bin/python3.10 ./autofill.py
- Set crontab task:
crontab -e
- Fill in these expression:
# automatically filling in health info in EVERYDAY 14:30
30 14 * * * bash /dir/to/autofill-health-info/autofill.sh >> /dir/to/autofill-health-info/crond-execution.log 2>&1 &
- In local machine, auto login, auto fill, auto submit
- Identify whether the user has submitted the information
- In server, perform above actions
- Support multiple users
- If fail, logging related error, skip current user and not affect next user, notify manager.
The MIT License (MIT)