Scrape - How to get a specific (dynamic) value

Good evening,

This is the first thing in my Home Assistant where I’m really lost and even after reading a lot of topic in the community, watched different youtube guides and checked a few other sites I still do not get this up and running.

The value which I’d like to scrape is generated via javascript and I have tried several select values in my scape platform section but either the value of the data is unknown or the data returns empty.

The website from which I want to scrape the data is:
´https://www.fitnesspark.ch/standorte/zuerich/sihlcity

The value is “Aktuelle Gäste” or (optional) “Freie Plätze”
My current section in my sensors.yaml looks as follows:

I also tried “.currentVisitors” for the select parameter and also the full selector (which I get via Chrome via inspection mode):
body > div.rf-content > div:nth-child(4) > div.row > div > div > div > div:nth-child(2) > span.currentVisitors

Any hints what I’m doing wrong or what my error in reasoning is?

Thanks.

P4SQL

Did you ever figure this out? I’m in the same boat … can’t figure out what to specify for the “select” parameter

Hi tggman,

not so far. It seems the dynamic content is separately loaded after the main content of the page. So just trying to fetch the whole page as “text” and then select the right field won’t work at all.

I’m a Python noob, but it tried some basic scrape steps. Work in progress.

I’ve seen someone made a HACS integration plugin for a gym chain called “Crunch-o-meter”, but they provide an API interface. So I was thinking about asking Migros to provide something similiar :wink:

https://github.com/GuyLewin/home-assistant-crunch-o-meter

Regards
P4SQL