Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundesanzeiger not working properly anymore #125

Closed
baniasbaabe opened this issue Oct 28, 2023 · 6 comments
Closed

Bundesanzeiger not working properly anymore #125

baniasbaabe opened this issue Oct 28, 2023 · 6 comments
Assignees

Comments

@baniasbaabe
Copy link

Running the following sample code:

from deutschland.bundesanzeiger import Bundesanzeiger
ba = Bundesanzeiger()
data = ba.get_reports("Deutsche Bahn AG")

throws the following error:

[/usr/local/lib/python3.10/dist-packages/deutschland/bundesanzeiger/bundesanzeiger.py](https://localhost:8080/#) in __find_all_entries_on_page(self, page_content)
     88         soup = BeautifulSoup(page_content, "html.parser")
     89         wrapper = soup.find("div", {"class": "result_container"})
---> 90         rows = wrapper.find_all("div", {"class": "row"})
     91         for row in rows:
     92             info_element = row.find("div", {"class": "info"})

AttributeError: 'NoneType' object has no attribute 'find_all'
@baniasbaabe
Copy link
Author

Nvm, Bundesanzeiger has downtime rn. But still, could a proper warning as an output be useful (if there are maintenance phases)?

@wirthual
Copy link
Member

wirthual commented Nov 8, 2023

The bundesanzeiger API is not auto generated so it would be possible to add a simple check if the request to the server was successful before proceeding.

Happy to merge the needed changes if you want to tackle it.

@matrop
Copy link

matrop commented Nov 14, 2023

Hey there, I'd like to tackle this issue if it's fine for you guys. Could you assign it to me?

@wirthual
Copy link
Member

wirthual commented Nov 19, 2023

I merged your PR. Would be good to add an test case to see if the exection is thrown if the url is not availble :) E.g. test the __response method with an url which is not available.

Something like this

@matrop
Copy link

matrop commented Nov 20, 2023

Sure, I'll create a new PR for this shortly 👍

@wirthual
Copy link
Member

Tests also merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants