Scrape Sensor not working for Australia COVID Live Data *SOLVED*

Hello,

I would like to scrape COVID case data from

In particular I want three separate sensors

I have attempted the below to no avail. Can someone please confirm if HA only supports CSS path and not Xpath?

  - platform: scrape
    name: NSW Covid Cases - Total
    resource: https://covidlive.com.au/report/daily-cases/nsw
    select: "#content > div > div > section > table > tbody > tr:nth-child(2) > td.COL3.CASES"

Is there a way for me to debug this? the logs are fairly vague
image

Using CSS Selector Tester from CSS Selector Tester - Chrome Web Store i managed to get it working :slight_smile:

For anyone else interested though what is confusing is the select statement above also worked for css selector tester


  - platform: scrape
    name: NSW Covid Cases - Total
    resource: https://covidlive.com.au/report/daily-cases/nsw
    select: ".DAILY-CASES tr:nth-child(2) .COL3.CASES"

  - platform: scrape
    name: NSW Covid Cases - Today
    resource: https://covidlive.com.au/report/daily-cases/nsw
    select: ".DAILY-CASES tr:nth-child(2) .COL5.NET"

  - platform: scrape
    name: NSW Covid Cases - Last Update
    resource: https://covidlive.com.au/report/daily-cases/nsw
    select: ".DAILY-CASES tr:nth-child(2) .COL1.DATE"

2 Likes

Iā€™m not entirely sure I get how it works, but thanks heaps - I was banging my head against exactly the same issue, and had no idea how to fix it!! :smiley: