This is a simple Python script that scrapes the internal web pages of HP Printers for data such as page count, toner level, and maintenance kit level. After the script pulls all the data, it exports it to an .xlsx file in the running directory. If the .xlsx file already exists, it will append the data. If not, it will create a new file.
This script has parameters customized for my own environment, but things like the printer names and the quanity of printers can be changed.
Example Output:
Sure. You would need to find the specific HMTL tag of the information you want to scrape and pass it off into the script.
See requirements.txt for the libraries you will need for this script. They are:
- BeautifulSoup
- Pandas
- Datetime (default Python library - no need to install)
- Requests (default Python library - no need to install)
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