Scraping stock product not working

I want to scrape the stock of a product: https://www.ing.nl/punten/productdetail/1009785
It’s called Uitverkocht in dutch. I have tried many configurations but I can’t get it to work.
Someone who can help me?

Well, unfortunately there is nothing to scrape on that page. HA’s scrape integration only sees the raw HTML, but what you see is a complex JavaScript application that renders HTML on the fly.

The next best thing is normally to look for JSON data that is fetched from the server, and indeed there is this https://www.ing.nl/api/loyalty-shop/catalog/products/1009785, but unfortunately it does not contain valid JSON, so the rest integration won’t help either.

Another option is to fetch that broken JSON externally (e.g. using curl on the command line) and then extract the data using a regular expression.

Thanks for helping me out, i gonna figure out how a expression works.

1 Like