Hi, i’m trying to build a scrape for my weather station. I’ll be happy to share when I reach the 100% functionality.
I can scrape a raw of a table with hold the temprature with “select”:
now i need to set a value_teamplace in the scraping config for thet only the result of “value=8.30”, indeed the 8.3 (which could be also -1.5 if it’s freezing…).
How can i do this? Thanks since now!
i quote myself and report back in case others need that. with two split i’ll get the needed values.
This sensor returns me a “Alto” Value with is ok, but I want to map the values to numbers so I can graph them, I tried this but of course is not working:
Have postet this one before a while ago: I have tried to use select command, but in this case I have no clue which word I could look for as the word I am trying to use is shown several times. Maybe somebody could help with this to get this values out to use in HA. I would need the three yellow marked figures in the screenshot.
The weblink for the site is http://77.119.243.51:86
I am afraid it will not be very easy as there are no selectors to find. You could try to search for all elements like in the example of the scrape integration:
# Example configuration.yaml entry
sensor:
- platform: scrape
resource: http://77.119.243.51:86
name: Temperature Cellar
select: "td"
index: 60 #experiment with this number to find the correct value
unit_of_measurement: "C"
Once you find the correct TD element it should be easy to clone this code and get the next value.
thanks for your answer, I am not sure what you mean to clone the code and get next value? I can say that I am not an expert in this topic, so I feel it will be too complicated for me to get that to work.
So far I have added the example you gave me to my config, I have restarted HA but don’t see a sensor/entity called Temperature Cellar yet, so maybe I am doing something wrong.
In theory this should work, but I am getting an error in the logs… something to do with headers. Possibly related to the port being different…
sensor:
- platform: scrape
resource: "http://77.119.243.51:86"
name: Temperature Cellar
select: "td"
index: 7 #experiment with this number to find the correct value
value_template: '{{ ((value.split(" ")[0]) | replace (",", ".")) }}'
unit_of_measurement: "°C"
- platform: scrape
resource: "http://77.119.243.51:86"
name: Hunidity Cellar
select: "td"
index: 8 #experiment with this number to find the correct value
value_template: '{{ ((value.split(" ")[0]) | replace (",", ".")) }}'
unit_of_measurement: "%"
- platform: scrape
resource: "http://77.119.243.51:86"
name: Air Pressure Cellar
select: "td"
index: 9 #experiment with this number to find the correct value
value_template: '{{ ((value.split(" ")[0]) | replace (",", ".")) }}'
#root > div > div.page-container > div > div > div > div.device-device-realtime-dashboard > div > div > div.device-widget.square.temp > div.device-temp-widget.center-aligned > div > div.top > span > span.fdp-val
looks like the data is loaded via javascript, see page source: <noscript>Sorry, Javascript must be enabled to use the Ambient Weather Dashboard.</noscript>
That means the data is not available when the page html conten is loaded and is loaded afterwards via javascript. that means you can’t scrape it.
May sugest either using one of the multiple weather integrations already available or create your own since Ambient Weather has an API
Hi all, I need some help with my scraping.
I’m trying to extract the values of my solar panel controller web page. It used to work but I updated multiscrape and now it doesn’t support the property index anymore.
My web page is like that:
I’m trying to extract the values in rows after the header. I tried body > table > tr:nth-child(2) > td:nth-child(1) and also table > center > tr:nth-child(2) > td:nth-child(5) but I keep getting errors like:
2022-06-10 12:54:34 DEBUG (MainThread) [custom_components.multiscrape.sensor] Scraper_noname_0 # Panel 1 Name # Start scraping to update sensor
2022-06-10 12:54:34 DEBUG (MainThread) [custom_components.multiscrape.scraper] Scraper_noname_0 # Panel 1 Name # Tag selected: None
2022-06-10 12:54:34 ERROR (MainThread) [custom_components.multiscrape.sensor] Scraper_noname_0 # Panel 1 Name # Unable to scrape data: Could not find a tag for given selector.
Consider using debug logging and log_response for further investigation.
2022-06-10 12:54:34 DEBUG (MainThread) [custom_components.multiscrape.sensor] Scraper_noname_0 # Panel 1 Name # On-error, set value to None
2022-06-10 12:54:34 DEBUG (MainThread) [custom_components.multiscrape.entity] Scraper_noname_0 # Panel 1 Name # Updated sensor and attributes, now adding to HA
Any idea what I’m doing wrong?
Thanks a lot, appreciate any help.
I have one more question, the scraper works perfectly, but it generates a lot of errors when my PC is off. Which makes sense of course, but is there a way to suppress errors for one “scrape” without just suppressing all Multiscrape errors?