Skip to content

Cannot initialise integration - Unexpected error: 'NoneType' object has no attribute 'find' #1859

@chriscolden

Description

@chriscolden

Name of Council

Birmingham City Council

Issue Information

There is an issue with the Birmingham City Council

Logger: custom_components.uk_bin_collection
Source: custom_components/uk_bin_collection/__init__.py:348
integration: UK Bin Collection Data ([documentation](https://github.com/robbrad/UKBinCollectionData/wiki), [issues](https://github.com/robbrad/UKBinCollectionData/issues))
First occurred: 16:40:58 (2 occurrences)
Last logged: 16:41:07

[UKBinCollection] Unexpected error: 'NoneType' object has no attribute 'find'
Traceback (most recent call last):
  File "/config/custom_components/uk_bin_collection/__init__.py", line 348, in _async_update_data
    data = await asyncio.wait_for(
           ^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/asyncio/tasks.py", line 507, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.13/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 101, in run
    return self.client_code(
           ~~~~~~~~~~~~~~~~^
        council_module.CouncilClass(),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<9 lines>...
        council_module_str=self.parsed_args.module,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 121, in client_code
    return get_bin_data_class.template_method(address_url, **kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/uk_bin_collection/uk_bin_collection/get_bin_data.py", line 61, in template_method
    bin_data_dict = self.get_and_parse_data(this_url, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/uk_bin_collection/uk_bin_collection/get_bin_data.py", line 82, in get_and_parse_data
    bin_data_dict = self.parse_data(page, url=address_url, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/uk_bin_collection/uk_bin_collection/councils/BirminghamCityCouncil.py", line 115, in parse_data
    rows = soup.find("table", class_="data-table").find("tbody").find_all("tr")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'find'

To reproduce I added the integration. Selected Birmingham City Council and provided the UPRN and post code along with the url https://www.birmingham.gov.uk/xfp/form/619

Verification

  • I searched for similar issues at https://github.com/robbrad/UKBinCollectionData/issues?q=is:issue and found no duplicates
  • I have checked my address/postcode/UPRN works on the council's website
  • I have provided a detailed explanation of the issue as well as steps to replicate the issue
  • I understand that this project is run by volunteer contributors therefore completion of this issue cannot be guaranteed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions