danieldotnl/ha-multiscrape

Can't scrape certain sites

Closed this issue · 1 comments

Version of the custom_component

7.0.2 (latest)

Configuration

Add your logs here.

Describe the bug

A clear and concise description of what the bug is.

Debug log

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 794, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1728, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 457, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 509, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 539, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 507, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 742, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 705, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/multiscrape/service.py", line 123, in _async_scrape_service
response[name] = {"value": scraper.scrape(sensor_selector, config_name)}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/multiscrape/scraper.py", line 136, in scrape
raise ValueError("Could not find a tag for given selector")
ValueError: Could not find a tag for given selector
2024-05-02 13:41:50.047 INFO (MainThread) [custom_components.winix.manager] Updating devices
2024-05-02 13:41:50.155 ERROR (MainThread) [custom_components.winix.driver] Error parsing response json, received {'statusCode': 200, 'headers': {'resultCode': 'S100', 'resultMessage': 'no data'}, 'body': {}}
Traceback (most recent call last):
File "/config/custom_components/winix/driver.py", line 193, in get_state
payload = json["body"]["data"][0]["attributes"]
~~~~~~~~~~~~^^^^^^^^
KeyError: 'data'


Add your logs here.

Please ask support questions on the home assistant forum.