Skip to content

Warning for Mistery Works#85

Open
encars28 wants to merge 1 commit into
wendytg:masterfrom
encars28:mistery_works
Open

Warning for Mistery Works#85
encars28 wants to merge 1 commit into
wendytg:masterfrom
encars28:mistery_works

Conversation

@encars28

@encars28 encars28 commented Dec 26, 2022

Copy link
Copy Markdown
Contributor

It would fix #81

if "Error 404" in self._soup.find("h2", {"class", "heading"}).text:
The code was raising an Atribute Error because it couldn't find a h2 tag with the class "heading" (as it is a Mistery Work, its page would differ from the normal work pages). When bs4 can't find a tag, it puts that variable to None, so when we tried to acces the text attribute of a None variable an error would occur

When the work is being loaded it warns the user if it's a Mistery Work and stops loading the rest, so that Mistery Works no longer cause an error.
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

Successfully merging this pull request may close these issues.

Works hidden by being added to a collection cause an AttributeError if you try to initialize them.

1 participant