This project scrapes the website lesco.gov.pk and dbill.ptcl.net.pk to download bills either as pdf for keeping as a record or downloading.
- wget
- curl
- node.js
- chrome/chromium installed for converting html to PDF
Add the customer ids in the file customer_ids.json. Following will be its format:
{
"lesco": [
{"id":"YOUR_ID", "format":"html/pdf", "tag": "TAG"}
],
"ptcl": [
{ "phone": "PHONE_WITHOUT_AREA_CODE", "account_id": "ACCOUNT_ID", "tag":"TAG"}
]
}
node index.js
The downloaded bills will be placed in downloads
folder in the format:
downloads:
- BILL_MONTH (2022-01):
- TAG (home/office):
- ID.pdf
- PTCL_phone_num.pdf
Support has been added to send emails whenever a new bill is encountered. To configure it, create a new file mailer-config.json having the SMTP setting similar to below
{
"service": "gmail",
"host": "smtp.gmail.com",
"port": 587,
"secure": false,
"auth": {
"user": "USERNAME",
"pass": "PASSWORD"
}
}
Add the email field in customer_ids.json file.