# Sensor scrape

**URL:** <https://forum.hacf.fr/t/sensor-scrape/9677>\
**Category:** Entraide Home Assistant\
**Tags:** aide\
**Created:** [Février 21, 2022, 1:06 UTC](https://forum.hacf.fr/t/sensor-scrape/9677 "2022-02-21T13:06:52Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Clemalex](https://forum.hacf.fr/user_avatar/forum.hacf.fr/clemalex/32/3691_2.png) [@Clemalex](https://forum.hacf.fr/u/Clemalex)\
**Post date:** [Février 23, 2022, 10:29 UTC](https://forum.hacf.fr/t/sensor-scrape/9677/10 "2022-02-23T22:29:59Z")

</div>

Pas sûr du besoin mais si c'est pour afficher l'image, voici comment faire :

```auto
#déclaration de la plateforme scrape dans configuration.yaml ou autre
sensor:
  - platform: scrape
    name: moon
    resource: https://www.timeanddate.com/astronomy/france/cherbourg-octeville
    select: "#cur-moon"
    attribute: src
    value_template: 'https://www.timeanddate.com{{value}}'

```

```auto
#Affichage de l'image dans une carte markdown + card-mod pour le centrage
type: markdown
content: |-
  <div>
  <img src="{{states("sensor.moon")}}" />
  </div>
card_mod:
  style:
    ha-markdown:
      $: |
        div {
          display: block;
          text-align: center;
        }

```

 ![image](https://forum.hacf.fr/uploads/default/original/2X/8/8ff98f9c4d8ef3ee9aed3ade89cbc219a726d390.png)

C'était bien ça le but ?

---

_[View the full topic](https://forum.hacf.fr/t/sensor-scrape/9677)._
