mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-18 23:06:58 +00:00
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 <goran.johansson@shiftit.se>
This commit is contained in:
parent
4e23e06aa3
commit
7be56f47a5
@ -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)"
|
||||
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user