Can anyone help me scrape this number?

Hello friends,

I am looking for a way to get a number from a simple web page with the scraper component. Having looked around, I just don’t get it. Could anyone give me a hint how to get the number (1 in this case) at the end of this line:

<p ALIGN=CENTER>STEEL Industrial 11 Kg FULL TANKS : 1</p>

Here is the entire web page:

<!DOCTYPE html>
<html>
    <body>
    <body bgcolor = beige>
        <head>
        <title>Gassautomat SC 160 Vormsund Inventory Page</title> 
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        </head>

        
        <p ALIGN="CENTER"><b>MAGAZINE INVENTORY OF SC 160 Vormsund</b></p>

        <p ALIGN=CENTER>STEEL Standard 11 Kg FULL TANKS     :  2</p> 
        <p ALIGN=CENTER>STEEL Industrial 11 Kg FULL TANKS     :  1</p> 
        <p ALIGN=CENTER>COMPOSITE Standard 10 Kg FULL TANKS :  5</p> 
        <p ALIGN=CENTER>COMPOSITE Industrial 10 Kg FULL TANKS :  0</p> 
        <p ALIGN=CENTER>STEEL 5 Kg FULL TANKS     :   3</p> 
        <p ALIGN=CENTER>COMPOSITE 5 Kg FULL TANKS :   3</p>           

    </body> 
</html>

Try:

Select: 'p:nth-of-type(3)'
value_template: '{{ value.split(":")[1].split("<")[0] }}'

Holy moly, that worked! Thank you very much, @ufulu! The only thing I see now is that the sensor outputs:

‘  1’

So it would seem the result contains the symbols as well as the number, and also a space. Is it possible to get rid of the symbols and space and only leave an actual number that can be used for automation purposes?

Never mind, I think I got it! Seems like a typo in my end. Thanks a alot, @ufulu!

Glad to hear that! BTW: can’t wait to try out your “children wake up too early” automation! I like the idea, so thank you for that inspiration.

Thank you for that, I hope it can be useful for you!

hijacking this topic because I have the same question.

Cant get it to work …

      <br><br>
      <h4 class="text-bold">Eerstvolgende data</h4>
      <ul class="nextPickupList">
       <!--  <li>{{nextPickup[0] | date : "EEEE d MMMM"}}</li>
        <li>{{nextPickup[1] | date : "EEEE d MMMM"}}</li>
        <li>{{nextPickup[2] | date : "EEEE d MMMM"}}</li> -->
        <li><img class="legendIcon" ng-src="img/{{nextPickup[0].icon}}.png" alt=""> {{nextPickup[0].start}}</li>
        <li><img class="legendIcon" ng-src="img/{{nextPickup[1].icon}}.png" alt=""> {{nextPickup[1].start}}</li>
        <li><img class="legendIcon" ng-src="img/{{nextPickup[2].icon}}.png" alt=""> {{nextPickup[2].start}}</li>
      </ul>

this code will display this image in a browser :

I want to scrape the data from it.

this is what I have now :

- platform: scrape
  resource: !secret afvalportaalurl
  name: Afval datum
  select: "?????????"
  scan_interval: 21600

I doubt the scrape component will work with this website as it seems that the dates are dynamically injected into the site.