Hi there,
I’m having a hard time scraping crypto currency values. I must admit not being familiair with Beautiful Soup at all.
I hope someone can help me out extracting certain values since the coinmarketcap component is broken since 0.55 or so.
For example; I would like to extract the Litecoin value from this webpage.
The following configuration is not working:
sensor:
- platform: scrape
resource: https://www.cryptocompare.com/coins/ltc/overview/USD
name: LTC-USD
select: 'price-value'
and creates the following errors in my log:
2017-12-01 20:03:40 ERROR (MainThread) [homeassistant.components.sensor] Error on device update!
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 217, in async_add_entity
yield from entity.async_device_update(warning=False)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 306, in async_device_update
yield from self.hass.async_add_job(self.update)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/scrape.py", line 120, in update
value = raw_data.select(self._select)[0].text
IndexError: list index out of range
I also tried the following without any luck:
select: ‘.price’
select: ‘price’
select: “price-value”
select: “.price-value”
Can someone help me out or point me in the right direction?
P.S. I was using the following for several weeks which was working fine but suddenly it stopped working (probably because now there is a ddos check before entering the website…(?))
sensor:
- platform: scrape
resource: https://www.coingecko.com/en/coins/litecoin
name: LTC-USD
select: ".coin-value"