Oh, this is actually much more strict than the other place. 'allow_tags' specifices a list of all and only the allowed tags; everything else is stripped. remove_unknown_tags=True is the default, so it has to be set to False for allow_tags to be used, because allow_tags supersedes it. This is a quirk of the lxml module. the use of page_structure here is superfluous.