This project is designed to scrape data from HP printers and store the information in an Excel file. The data includes page count, toner level, and maintenance level for each printer.
- Python 3.8 or higher
uv
for project management
-
Clone the repository:
git clone https://github.com/Brand07/hp-printer-scrape.git cd hp-printer-scrape
-
Install
uv
:pip install uv
-
Install project dependencies:
uv sync
-
Run the script to scrape printer data:
uv run python main.py
-
The script will generate or update the
Printer_Metrics.xlsx
file with the latest data.
Example Output:
HP_Printer_Scrape.py
: Main script to scrape printer data and save it to an Excel file.Printer_Metrics.xlsx
: Excel file where the scraped data is stored.uv.lock
: Lock file foruv
project management.
- Update the
printers
dictionary inHP_Printer_Scrape.py
with the IP addresses of your printers. - Modify the tags for scraping if necessary.
This script requires that you disable Encrypt All Web Communication (not including IPP) on the printer. This can be done from the internal webpage under the Networking Tab >> Mgmt. Protocals. This allows the script to request the webpage, otherwise the script would fail to reach the webpage.
Do this at your own risk as you are disabling a security feature on your printer
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License.