Open auchtetraborat opened 2 years ago
The error appears to be caused by the websites data being in a different format then expected.
[position, historical_name] = tds[1].text.strip().split(".) ", 1)
tds[1] usually looks something like: "
A similar error will appear in the next line:
historical_location = tds[2].text.strip().split(".) ", 1)[1]
Usually: "
The data can also be viewed here: https://www.handelsregister.de/rp_web/result.do?Page=4
Unfortunatly, I dont know enough about the Handelsregister module's logic to proberly add input handling for this format.
I found the bug. It is in the method def __extract_history(self, row):
in line 203 in deutschland/handelsregister/registrations.py
Replace these lines:
[position, historical_name] = tds[1].text.strip().split(".) ", 1)
historical_location = tds[2].text.strip().split(".) ", 1)[1]
with these ones:
position = tds[1].text.strip().split(".) ", 1)[0]
historical_name = tds[1].text.strip().split(".) ", 1)[1:]
historical_location = tds[2].text.strip().split(".) ", 1)[1:]
Now it should be working. Hope this helps.
Running the demo code in the README.md for the Handelsregister module returns an error.
How to reproduce:
Expected result:
What I got instead:
My env: