Hi all
I am trying to build my own scraper to gather information about water supply outages in my neighborhood. I need to search for specific strings inside a span, navigate to its parent link and then look for another string - a bit too complex to solve with the scraper component I guess.
The python script runs perfectly in the virtual environment I configured for hass in my Raspberry Pi. However, I get an error whenever the command line sensor is triggered. Since the only message I get in the logs is âcommand failedâ I tried to simplify the code in order to detect what is wrong with it. I realized that a simple print(âtestâ) works as expected, but as soon as BeautifulSoup is imported, the sensor execution fails.
sensor.yaml
- platform: command_line
name: Scraper
command: âpython3 /home/homeassistant/.homeassistant/script/script.pyâ
script.py --> fail
from bs4 import BeautifulSoup
print(âtestâ)
I would like to know if there is a right way to import this module. I wouldnât mind if I cannot use my scraper at all, as long as I understand what is going on. I wish I had enough skills to go deeper in the troubleshooting, I am counting on your help to move on.
Thanks in advance.