Help with scraper

I’m trying to scrape the Kilowatt hours field from this site.
https://sweetwaterutilities.com/Rates.htm

This is what I’ve got.

sensor:
  - platform: scrape
    resource: http://www.sweetwaterutilities.com/Rates.htm
    name: "SUB Rate"
    select: "#residential_electric_kilowatt_hours"
    index: 0
    unit_of_measurement: "$/Kwh"

Any idea what I’m doing wrong?

Thanks!

The HTML element does not actually contain the desired data when you fetch the raw HTML. What you see in the web browser is not what the scrape integration sees.

But you might be in luck, because it appears that the actual data is fetched as JSON from this URL and you could try using the rest integration to find the value you are looking for: https://utilityservices.orbitmobiles.com/api/data/eRBjUbtFo/Rates

1 Like

Awesome. Thanks! Took me a minute to figure out how you found that. I didn’t realize I could just plug js/site.js into the path and see the javascript.

1 Like