RESOLVED: Scrape intermittent issue

Hi,

Where I live, in winter times, we cannot park our cars in the street when the city is taking off the snow. We have a web page that we need to go to see if we can park the car in the street for the night. Rather than go check the website every day, I made a scrape sensor in home assistant with an automation that send a notification when the city publish it. The problem is that the scrape sensor returns error once in a while, so the sensor has “unavailable” value.

Here is the code from the configuration.yaml file:

scrape:
  - resource: https://www.victoriaville.ca/page/138/stationnement.aspx
    timeout: 120
    sensor:
      - name: "Parking"
        unique_id: 46bf8447-2777-437a-89ff-f4701498f2ee
        icon: mdi:alpha-p-circle-outline
        select: "section.parking-status"
        value_template: >
          {% if 'Mise à jour' in value %}
            {{ 'WAITING' }}
          {% elif 'AUTORISÉ' in value%}
            {{ 'PARKING' }}
          {% else %}
            {{ 'NOPARKING'}}
          {% endif %}

I’ve set the log level to debug, but it doesn’t show anything that would help:

2023-01-01 16:13:27.458 DEBUG (MainThread) [homeassistant.components.rest.data] Updating from Stationnement - Ville de Victoriaville
2023-01-01 16:13:32.465 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: Stationnement - Ville de Victoriaville failed with [Errno -3] Try again
2023-01-01 16:13:32.468 ERROR (MainThread) [homeassistant.components.scrape.coordinator] Error fetching Scrape Coordinator data: REST data is not available
2023-01-01 16:13:32.469 DEBUG (MainThread) [homeassistant.components.scrape.coordinator] Finished fetching Scrape Coordinator data in 5.011 seconds (success: False)
2023-01-01 16:13:32.493 DEBUG (MainThread) [homeassistant.components.scrape.sensor] Parsed value:

La nuit prochaine

Stationnement de nuit AUTORISÉ
Dans les rues au cours de la nuit du dimanche 01 au lundi 02 janvier 2023, entre minuit et 7h00 du matin.
Plus d’infos

What is strange is that rest.data reports an error but scrape.sensor get a value…

I tried to set the timeout to 2 minutes, but I still get the error.

Thanks for your help

I was running version 2022.12, since I updated to 2023.01 it’s working without issue. My guess is that something was broke and they fixed it in the new release.

I have the same problem throughout versions 2023.11 - 2023.12.1. Has anyone encountered this too?

That’s weird, I didn’t have the issue with these versions