I've been building https://github.com/Pale-Vessel/ao3_chapter_lengths for the last few weeks. For the most part it works, but occasionally it will fail to find any divs which should contain the chapters. Specifically,
- It entirely works (up to a margin of error which i think is to do with how it separates words) on https://archiveofourown.org/works/24597805, a work which is over 1.5 million words in total but whose chapters are at most 15,000 words long
- It fails to find any chapters on https://archiveofourown.org/works/12975126/chapters/29662455, a work with fewer total words but whose chapters are on the whole much longer, around 30,000 words each by my rough estimate (copy-pasting into wordcounter.net)
- Bizarrely, it succeeds at finding the one chapter of https://archiveofourown.org/works/22822339, a random work I picked that has just 1 chapter of nearly 45,000 words - which I'm almost sure all the chapters on the second work are shorter than. And even if there was one chapter too long for the div, it seems very odd that that would make it unable to load any of the chapters, some of which I have checked myself to be shorter than 45,000 words.
I'm sort of at a loss here - I'm not very familiar with HTML parsers orscraper, and I can't really upload my own works to ao3 to test things as I'd rather not get banned for spam.