Skip to content

Bugfix: Catch IndexError on search results #20

@tharndt

Description

@tharndt

There exist search results where the logic to collect 'history' does not apply and fails with an IndexError. A first and simple approach to this issue is to continue on IndexError and ignore corrupted information of entries.

Change the following lines in handelsregister.py...

113    for i in range(hist_start, len(cells), 3):
114       d['history'].append((cells[i], cells[i+1])) # (name, location)

...to:

113    for i in range(hist_start, len(cells), 3):
114        try:
115            d['history'].append((cells[i], cells[i+1]))  # (name, location)
116        except IndexError:  # there might be entries where this logic does not apply
117            continue

Alternatively the author(s) should have another look at the results and the parsing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions