Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 96121

How to Scrape Multiple Values

$
0
0

@ben-digitalhive wrote:

Hi there - I am trying to use the SCRAPE component to pull a tag from my local council website - garbage collection and have this successfully pulling the first date. I have think I have enough understanding to pull the second tage however my question is:

Q: How do you run the SCRAPE platform and pull multiple tags to different variables? And ideally do this in one go (i.e. hit the website once and pull multiple tags as opposed to running a separate scrape for each variable)

# Add a web scraper to get garbage collection days from Auckland Council website
  - platform: scrape
    resource: 'https://www.aucklandcouncil.govt.nz/rubbish-recycling/rubbish-recycling-collections/Pages/collection-day-detail.aspx?an=12341658037'
    select: ".m-r-1"
    name: "Garbage Collection Next"
    value_template: > 
        {% set strtext = value + " 2020" %}
        {{ strptime(strtext.split(' ', 1)[1], '%d %B %Y') }}
    unit_of_measurement: date
    scan_interval: 86400

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 96121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>