Scrape integration to check two values

Hi all,

Im trying to use the Scrape integration, to check if a website contains one of two specific values in a

tag.

Im having a pretty hard time, so I hope one of you have a quick hint that can help me.

I want to check if text1 or text2 is present in the

below

<div class="sitemaintenance-title">xxxxxx text1 xxxxx test2 xxxxxx xxxxxxx</div>

If you have successfully parsed the data, then you can build a template sensor, to search for text1 or text2.

For example,

{% if 'text1' in states('sensor.scrape') or 'text2' in states('sensor.scrape') %}
True
{% else %}
False
{% endif %}
1 Like