Issue: TypeError: Invalid type for url. Expected str or httpx.URL, got : None
Cannot make multiscrape working.. Any ideas how to fix this?
My config:
- resource: "https://ebok.mpwik.wroc.pl/trust/zuzycie-wody?p=XXX"
scan_interval: 86400
verify_ssl: false
form_submit:
resource: "https://ebok.mpwik.wroc.pl/login"
submit_once: true
method: POST
verify_ssl: false
select: "loginForm.form-card"
input:
login: !secret mpwik_login
password: !secret mpwik_password
sensor:
- unique_id: water_usage_daily
name: Water Usage Daily
device_class: water
select: "k-table-zuzycie-wody > "
unit_of_measurement: "m3"
value_template: '{{ value.split("<!--?-->")[0] }}'
on_error:
log: warning
value: none
Here is log:
2025-05-23 10:47:36.776 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140303448905248] Error handling message: Unknown error (unknown_error) Alexander from fe80::e328:d8cc:eda:6d20 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 821, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
msg.get("variables"), context=context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1836, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
self._handle_exception(
~~~~~~~~~~~~~~~~~~~~~~^
ex, continue_on_error, self._log_exceptions or log_exceptions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 556, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1012, in _async_step_call_service
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<9 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 624, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/multiscrape/service.py", line 101, in _async_scrape_service
result = await request_manager.get_content()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/multiscrape/coordinator.py", line 89, in get_content
response = await self._http.async_request("page", resource, cookies=self._cookies, variables=self._form_variables)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/multiscrape/http.py", line 113, in async_request
response = await self._client.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<8 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 1527, in request
request = self.build_request(
method=method,
...<9 lines>...
extensions=extensions,
)
File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 366, in build_request
url = self._merge_url(url)
File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 396, in _merge_url
merge_url = URL(url)
File "/usr/local/lib/python3.13/site-packages/httpx/_urls.py", line 121, in init
raise TypeError(
...<2 lines>...
)
TypeError: Invalid type for url. Expected str or httpx.URL, got : None
Issue: TypeError: Invalid type for url. Expected str or httpx.URL, got : None
Cannot make multiscrape working.. Any ideas how to fix this?
My config:
Here is log: