This is a scraper built with Puppeteer to fetch past electricity bills from the Kenya Power and Lighting Company (KPLC) website. I wrote a story about on how i built this here and why i built it here.
- Clone the repo
git clone https://github.com/username/kplc-bill-scraper.git
- Install Dependencies
npm install
- Replace with your Meter No in
index.js
// INSERT METER NO Here
startScraping("YOUR_METER_NO");
- Run the Script
node index.js
This will navigate to the Bill/Meter Query
Page, key in your meter no , execute the query on the page and return the result on the network tab.
The scraper can be easily customized to change the meter no. You can also change the button id to choose Account No for Post Paid results in index.js
// Radio Item Account No radio-1097
// Radio Item Meter No radio-1098
await page.click("#radio-1098");
If the scraper does not return the results, update the code to fit the workflow by using the newly generated html element ids(if they change).
This project is for educational/testing purposes only. Use at your own risk.
This project is not affiliated with or endorsed by the Kenya Power and Lighting Company. The creators have no intention of causing harm or prejudice against KPLC. This is an independent project meant for learning purposes only.
This project is licensed under the MIT License. See LICENSE for more details