I’m trying to setup some sensors with scrape, but cannot get them to work.
I have the following configuration:
- platform: scrape
resource: http://[URL]/
select: "#ctl00$ContentPlaceHolder1$Booking1span1"
- platform: scrape
resource: http://[URL]/
select: "#c5167 .tx-dmi-data-store div tabke tbody tr .Broedtekst"
But I get the following error in HA:
2017-08-27 15:44:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 181, in _step
result = coro.throw(exc)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
new_entity, self, update_before_add=update_before_add
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
yield from self.hass.async_add_job(entity.update)
File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
future.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/scrape.py", line 98, in update
value = raw_data.select(self._select)[0].text
IndexError: list index out of range