From 7be56f47a56423d06f141f9322c4823fef6198bd Mon Sep 17 00:00:00 2001 From: cvwillegen Date: Thu, 20 Jul 2023 14:59:12 +0200 Subject: [PATCH] Add example of POSTing data to retrieve sensors (#25929) * Add example of POSTing data to retrieve sensors I found it hard to get a website that required POST data to work, so to save others the work of looking up how to specify the data (in this case) and setting the correct headers, I made this real-life example. * Fix example to retrieve actual data I've added a working postcode/house number combination, so that users can play around with live data. * Removed duplicate resources * Update source/_integrations/scrape.markdown * Update source/_integrations/scrape.markdown --------- Co-authored-by: G Johansson --- source/_integrations/scrape.markdown | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source/_integrations/scrape.markdown b/source/_integrations/scrape.markdown index 55597980fa6..99d38e72257 100644 --- a/source/_integrations/scrape.markdown +++ b/source/_integrations/scrape.markdown @@ -259,3 +259,28 @@ scrape: ``` {% endraw %} + +### Container cleaning by CleanProfs in The Netherlands + +This example gets the container type and container cleaning date for the next two cleanings. + +```yaml +# Example configuration.yaml entry. Change postal code and house number to your own address. +scrape: + - resource: https://crm.cleanprofs.nl/search/planning + method: POST + payload: zipcode=5624JW&street_number=17 + headers: + Content-Type: application/x-www-form-urlencoded + sensor: + - name: "Type container 1" + select: "div.nk-tb-item:nth-child(2) > div:nth-child(1) > span:nth-child(1)" + - name: "Date container 1" + select: "div.nk-tb-item:nth-child(2) > div:nth-child(3) > span:nth-child(1) > span:nth-child(1)" + - name: "Type container 2" + select: "div.nk-tb-item:nth-child(3) > div:nth-child(1) > span:nth-child(1)" + - name: "Date container 2" + select: "div.nk-tb-item:nth-child(3) > div:nth-child(3) > span:nth-child(1) > span:nth-child(1)" + +``` +