#!/usr/bin/env python # coding: utf-8 # ## Web scraping # To get values from websites which don't provide an API is often only through scraping. It can be very tricky to get to the right values but this example here should help you to get started. This is very similar to the work-flow the [`scrape` sensor](https://home-assistant.io/components/sensor.scrape/) is using. # ### Get the value # Importing the needed modules. # In[1]: import requests from bs4 import BeautifulSoup # We want to scrape the counter for all our implementations from the [Component overview](https://home-assistant.io/components/). # # The section (extracted from the source) which is relevant for this example is shown below. # # ```html # ... #