Scraping from 4 different URLs, one requiring authentication has stopped working (the other 3 works ok). GUI shows “Unknown”
No improvement on 2022.6.1.
Sensor:
2022-06-03 15:51:29 WARNING (SyncWorker_3) [homeassistant.components.scrape.sensor] Index 'None' not found in None
2022-06-03 15:51:29 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'None' has no attribute 'split' when rendering '{{ value.split(" ")[9] }}'
I guess that no data is returned and possibly caused by authentication?
You are taking index 1 of “Body”, which is already wrong (only one body, so should be 0).
Then you are taking the 10th “word” from it, which roughly returns href="/ap.py/status"
It’s the line with rain and temperature values.
Yes it worked before upgrade. No change to the web page.
I receive no data at all, maybe that’s caused by Body - 1. I’ll try to change to 0.
Thanks, that is the problem. By changing to index I get data, still wrong data, but that’s related to the split. I will consider to rewrite the page to be more scrape friendly.
Again thank you for taking your time on this
/ Lars
Ah no, didn’t notice you actually have 2 “body” (strangely), so index 1 is correct for what you want, I guess, assuming there was not an HA change that made this invalid.
You actually have “index:” and “value_template:” on 2 different lines, do you? Not like what you show here…