[SOLVED] Need help to scrape data from website

hi,

i would like to scrape data from this website - the table where you can see the name of the lake and the corrsponding temperature:

http://www.wassertemperatur.org/oesterreich/

could you please give me a hint how to define the scrape function to achieve this?

i tried it with a couple of html tags. with td it shows at least the name of the first lake, when trying tbody the entity is no longer there to integrate in lovelace.

1 Like

Does that site have an api?

3 Likes

no, it doesn’t.

if it had one and they would provide it in json, how could i use the data with a custom integration? scrape would not work for it?

Do this.

go to the page and right click on the temp you want as a sensor:
image
Inspect element.

Then select:
CSS Selector:
image

Make a sensor in home assistant and put the CSS data in (in confguration.yaml under
Sensor:

  - platform: scrape
    name: Ausee Temperature Test
    resource: http://www.wassertemperatur.org/oesterreich/
    select: ".entry-content > table:nth-child(4) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(2) > span:nth-child(1)"

Result:
image

more info on the link I gave before:

11 Likes

thanks, it worked perfectly!

i read the scrape documentation before, but i just could not figure out, how to define “select”.

thanks!

Mark the “topic as solution” please :slight_smile:

Hi, I am trying to do the same for education but my chrome or edge browser doesn’t have the copy CSS option. Which browser are you using?

you have these options in firefox.

1 Like

Edge also (Inspect)

I tried edge also but I didnt found the css option there

@sender @Makis

when i tried to apply this procedure on other sites, unfortunately i was not able to scrape the data although the fields where properly identified when choosing inspect element.

on

http://laendris.donaustationen.at/index.php?module_id=6
http://laendris.donaustationen.at/index.php?module_id=6&action=details&pegelstelle_id=13&Tage=1&l_laende_id=33

i could not load the values on the overview as well as on the details page.

on

https://www.noel.gv.at/wasserstand/#/de/Messstellen/Details/207373/Wasserstand/3Tage

i also could not load the values. see corresponding screenshots 1-3.

could you imagine was the problem is and could you tell me, when the above procedure works and when not? i tried this now on a couple sites, it works perfectly on the one mentioned above but does not others.

thanks in advance!

pegel2

Hi all, I would like to take some information of the next website:

http://www.climaat.angra.uac.pt/boias/index2.htm

For example, how I can get the temperature shown in the last row of the table?
“Temperatura da água à superficie: 23 ºC” (Water surface temperature)

Hi folks. Can someone please help me get the KP-index from this site? I’ve tried and tried, but I can’t get my head around the formula. If it’s at all possible, that is. I would really appreciate it, thank you!
https://www.spaceweatherlive.com/en/auroral-activity.html

If you read the site faq you are advised not to do thst.