Hi,
I’ve been trying to create a couple of sensors showing the next high and low tides at my location but after a few hours trying several combinations I’m yet to succeed in scraping the correct data:
The page I’m trying to extract this from:
I’m attempting to extract only the time for the next high tide and next low tide (creating 2 sensors for this).
The CSS selector for each value seems to be clearly defined - 'hightime" and “lowtime” - but I can’t get any value back:
the relevant html code:
<p class="high-tide">Next <b><span class="tide"><i class="fa fa-arrow-up"></i>high tide</span> in Sao Domingos de Rana</b> is at <b><span id="hightime" class="tide">4:54 AM</span></b>, which is in <b><span class="tide"><span id="highcountdown">11 hr 48 min 26 s</span> from now</span></b>.</p>
sensor:
- platform: scrape
resource: http://www.surf-forecast.com/breaks/Carcavelos/tides/latest
name: Next High Tide
select: "#hightime"
scan_interval: 3600
I have tried a various combinations for the “select” value:
"#hightime.tide"
".high-tide #hightime.tide"
".high-tide b:nth-child(2) #hightime"
…and so on.
Most of the times I can’t get any value back - been at it for quite a while; debugger seems to return the entire html code of the page in the log.
Any ideas and/or help would be greatly appreciated.