Multiscrape Help with changing selector

Hi There,

I am currently using Multiscrape 8.0.2. I am trying to scrape a river level info from the Environment Agency website. I have very limited experience with HA and Multiscrape.
Generally the scraping is working fine and I get the level I need. The trouble is… when the river goes into flood, the selector changes from div:nth-child(3) to div:nth-child(4) and I have no idea how to work passed this.
My config is:

name: River Parrett Levels RL
resource: https://check-for-flooding.service.gov.uk/station/3397
scan_interval: 1200
log_response: true
sensor:
    - unique_id: RiverParrettLevelOath
      name: River Parrett Level Oath
      force_update: true
      device_class: volume
      select: div:nth-child(3) > div > div > dl > div:nth-child(1) > dd > span
      value_template: "{{ (value.split('m')[0]) }}"

This will work most of the time, but as soon as the river goes into flood warning, the selector changes from 3 to 4. Is there a way to combat this? I’ve tried using the latter div selector (if that’s the correct term and how it works) but then it returns blank.

Thanks

When I copied the selector using Chrome, I got this:
#impact-list > div.defra-flood-impact-list__row.defra-flood-impact-list__row–current > dt

Since that isn’t using nth-child at all, it would seem to be robust against whether or not there is a flood warning in effect.

That’s awesome, thank you! I had just used the top value and for some reason totally ignored the lower one :smiley: