Hi,
I am trying to scrape a few values from this website: LOGIN - Remocon NET
As you can see this requires a login which I think I have figured out with this configuration:
# Elco Remocon
multiscrape:
- resource: 'https://www.remocon-net.remotethermo.com/BsbPlantDashboard/Index/F0AD4E0B7C60'
scan_interval: 5
form_submit:
submit_once: True
resource: 'https://www.remocon-net.remotethermo.com/Account/Login'
select: "#login-form"
input:
Email: myUser
Password: 'myPassword'
extra: field
sensor:
- select: '#contentWrapper > div.container-fluid > table > tr > td:nth-child(1) > h5:nth-child(2)'
# select: '#content > div:nth-child(2) > div > table > tr:nth-child(3) > td:nth-child(2) > div > table > tr > td:nth-child(2) > div > div > div'
name: myvalue
This provides a value back as expected. But the issue is with some other values on the site which I can’t get displayed. The value I want to get is the temperature value as highlighted below:
If i use Copy selector I get:
#content > div:nth-child(2) > div > table > tbody > tr:nth-child(3) > td:nth-child(2) > div > table > tbody > tr > td:nth-child(2) > div > div > div
Trying this in the config gives me the following error in the logs (which I assume could be from this
2021-08-19 14:57:22 ERROR (MainThread) [custom_components.multiscrape.sensor] Sensor myvalue was unable to extract data from HTML
2021-08-19 14:57:22 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1183, in _sendfile_fallback
read = await self.run_in_executor(None, file.readinto, view)
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 485, in start
resp, reset = await task
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 440, in _handle_request
reset = await self.finish_response(request, resp, start_time)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 591, in finish_response
await prepare_meth(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_fileresponse.py", line 241, in prepare
return await self._sendfile(request, fobj, offset, count)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_fileresponse.py", line 96, in _sendfile
await loop.sendfile(transport, fobj, offset, count)
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1162, in sendfile
return await self._sendfile_fallback(transport, file,
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1192, in _sendfile_fallback
await proto.restore()
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 263, in restore
self._transport.resume_reading()
File "/usr/local/lib/python3.9/asyncio/sslproto.py", line 343, in resume_reading
self._ssl_protocol._transport.resume_reading()
AttributeError: 'NoneType' object has no attribute 'resume_reading'
2021-08-19 14:57:29 ERROR (MainThread) [custom_components.multiscrape.sensor] Sensor myvalue was unable to extract data from HTML
If I try the config without the 2 tbodies like this:
- select: '#content > div:nth-child(2) > div > table > tr:nth-child(3) > td:nth-child(2) > div > table > tr > td:nth-child(2) > div > div > div'
I don’t get an error in the logs but my value is empty. Any help or hint would be very much appreciated.
Thanks,
Thomas