Hello, i’m currently trying to scrape my weather station html status page. I tought i reached the end but instead the sensor are not populated. I debugget the scrape sensor and found in the logs that it retrive the page, but any filter (select) are applied (no results shown).
- platform: scrape
...
select: 'tr:nth-of-type(11) input'
value_template: "{{ value.split('value=')[1].split('\"')[1] }}"
Here you can find the whole webpage, thanks since now who can help!
edit:
i tried directly in shell with this script and it parse correctly the string i want as you can see. So maybe Hass get the value and the problem is in the value_template? Which indeed works fine in template editor… now i get as sensor value UNKNOWN
from bs4 import BeautifulSoup
import requests
URL="http://192.168.99.65/livedata.htm"
SELECT="tr:nth-of-type(11) input"
r = requests.get(URL)
data=r.text
soup = BeautifulSoup(data, "lxml")
print(soup)
val = soup.select(SELECT)
print("Output of SELECT: **************")
print(val)
print("**************")