Coder Social home page Coder Social logo

Comments (2)

auchtetraborat avatar auchtetraborat commented on August 13, 2024

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: "1.) xyz GmbH"
Before the error occurs, tds[1] is "-Deutsche Kreditbank Aktiengesellschaft Niederlassung Berlin ", containing no '.)'.

A similar error will appear in the next line:

historical_location = tds[2].text.strip().split(".) ", 1)[1]

Usually: " 1.) Bad Elster "
New format: "Berlin "

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.

from deutschland.

kiranmusze avatar kiranmusze commented on August 13, 2024

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.

from deutschland.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.