https://github.com/brand07/hp-printer-metrics-scrape
Python script that scrapes the internal web pages of HP Printers for data such as page count, toner level, and maintenance kit level.
https://github.com/brand07/hp-printer-metrics-scrape
beautifulsoup4 hp hp-printer pandas-dataframe pandas-python printer-metrics printers requests requests-library-python webscraper
Last synced: about 2 months ago
JSON representation
Python script that scrapes the internal web pages of HP Printers for data such as page count, toner level, and maintenance kit level.
- Host: GitHub
- URL: https://github.com/brand07/hp-printer-metrics-scrape
- Owner: Brand07
- License: mit
- Created: 2023-10-23T16:24:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-06T14:04:03.000Z (7 months ago)
- Last Synced: 2025-04-05T22:29:54.095Z (6 months ago)
- Topics: beautifulsoup4, hp, hp-printer, pandas-dataframe, pandas-python, printer-metrics, printers, requests, requests-library-python, webscraper
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HP Printer Scrape
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.
## Prerequisites
- Python 3.8 or higher
- `uv` for project management## Installation
1. Clone the repository:
```sh
git clone https://github.com/Brand07/hp-printer-scrape.git
cd hp-printer-scrape
```2. Install `uv`:
```sh
pip install uv
```3. Install project dependencies:
```sh
uv sync
```## Usage
1. Run the script to scrape printer data:
```sh
uv run python main.py
```2. The script will generate or update the `Printer_Metrics.xlsx` file with the latest data.
Example Output:

## Project Structure
- `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 for `uv` project management.## Configuration
- Update the `printers` dictionary in `HP_Printer_Scrape.py` with the IP addresses of your printers.
- Modify the tags for scraping if necessary.### Other Requirements
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
## Contributing
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit your changes (`git commit -am 'Add new feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.## License
This project is licensed under the MIT License.