Simplify working with sections
Right now, if you wanted to just work with a specific section (or other chunk of an article), you'd have to parse the full HTML and then isolate the section and re-parse it to get access to the wiki-extraction functions at that level. This is a bunch of unnecessary processing and BeautifulSoup provides a class called SoupStrainer
that allows for filtering while parsing to reduce this overhead. We'd likely want a smart way of incorporating in this functionality when instantiating at WikiStew
element that could take arbitrary function. And then perhaps have a helper function to filter based on desired section numbers or match against a given Element type?