Hello,
My ISP has an internal page (no auth) that shows the daily consumption of data. I would like to get this into home assistant for automation purposes. Using the browser dev tool, this is the value I need:
It is the 5.79 GB in td class. If I right click and copy the CSS selector, then it shows:
.table > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2)
If I use that as a selector, I get nothing:
#scrape:
- resource: http://185.120.28.1/user.php
scan_interval: 30
sensor:
- name: Internet Consumption
select: ".table > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2)"
value_template: '{{ value.split("GB")[0] }}'
unit_of_measurement: "GB"
I also tried index 1 and I didn’t get anything out of it. The sensor value is always unknown. I don’t have any clue about CSS and scraping. This is my first attempt at it.
What am I doing wrong here?