Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Home Assistant custom component for scraping multiple fields from a single request.

Notifications You must be signed in to change notification settings

drogfild/hass-multiscrape

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRICATED: This is not maintained anymore

Please see https://github.com/danieldotnl/ha-multiscrape for awesome component that does this and much more!

.

.

This fork adds possibility to login to html form before scraping. I'm calling it prelogin. See updated example configuration below. For more info about multipscrape itself see original author https://github.com/danieldotnl/hass-multiscrape

HA MultiScrape custom component

This Home Assistant custom component can scrape multiple fields (using CSS selectors) from a single http request (the existing scrape sensor can scrape a single field only).

It is based on both the existing Rest sensor and the Scrape sensor. The scraped fields are added as attributes on the sensor and using template sensors, you can see them as separate sensors. Most properties of the Rest and Scrape sensor apply.

Example configuration

  - platform: multiscrape
    name: home assistant scraper
    resource: https://www.home-assistant.io
    verify_ssl: false
    selectors:
      version:
        name: Current version
        select: '.current-version > h1:nth-child(1)'
        value_template: '{{ (value.split(":")[1]) }}'
      releasedate:
        name: Release date
        select: '.release-date'
    prelogin:
      preloginpage: https://url.of.that.site.com/login.html
      preloginform: 'loginForm'
      username_field: 'username'
      password_field: 'password'
      username: 'yourusername'
      password: 'yourpassword'

Roadmap for this fork

  • test test test

About

Home Assistant custom component for scraping multiple fields from a single request.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%