Hello,
I have been trying to scrape the artist and title from several radio websites in order to display them in my dashboard, but I don’t get it to work: the value of the sensor is always “unknown”.
What I did based on what I have read is copy the selector from the website:
And put them in the following sensors (2 different sites tested, with and without quotes around the url):
sensor:
- platform: scrape
name: "Q-Music Title"
resource: "https://qmusic.be/player/qmusic_be/index.html"
select: "#player-insertion-fixed > div > div > div > div.c-player__track > section > main > div > div:nth-child(1) > div > div.o-playlist__content > h3"
- platform: scrape
name: "Q-Music Artist"
resource: "https://qmusic.be/player/qmusic_be/index.html"
select: "#player-insertion-fixed > div > div > div > div.c-player__track > section > main > div > div:nth-child(1) > div > div.o-playlist__content > p"
- platform: scrape
name: "Nostalgie 80 Title"
resource: "https://www.nostalgie.be/radioplayer/nostalgie80"
select: "body > div.player > div.player__main > div > div > div > div > div.player-main__row > div.player-main__col-right > div > div > ul > li:nth-child(1) > div.player-playlist__col-text > div.player-playlist__text-name"
- platform: scrape
name: "Nostalgie 80 Artist"
resource: "https://www.nostalgie.be/radioplayer/nostalgie80"
select: "body > div.player > div.player__main > div > div > div > div > div.player-main__row > div.player-main__col-right > div > div > ul > li:nth-child(1) > div.player-playlist__col-text"
I get the sensor, but no value
What am I doing wrong?
Thanks