Splitting a HTML document using BeautifulSoup
Since no solution with a parser has been proposed to you, may I suggest that you should manage by yourself with regular expressions ?
The second point of Danish is of the same nature, as the name grep comes from 'global - regular expression - print'. But it is complicated by the fact the prettify functionality must be used for a preliminary treatment.
On the contrary, regular expressions are a powerful tool, that can be used directly on a text.
Could you give more information on what you want to do ?
We deal with long aggregated HTML documents (for conversion to PDF).
In some situations the aggregated HTML document must be split by chapter (dedicated HTML pages starting with a H1 tag) or by subchapters (dedicated HTML pages starting with each H1 or H2 tag). We are using BeautifulSoup for manipulating the aggregated HTML so far but we could not find a proper way using BeautifulSoup for extracting the subdocument (e.g. from first H1 to the next H2) in a proper way.