ArmindoFlores / ao3_api

An unofficial archiveofourown.org (AO3) API for python
MIT License
166 stars 64 forks source link

Warning for Mistery Works #85

Open encars28 opened 1 year ago

encars28 commented 1 year ago

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