Comment

Peter Bengtsson

Good point! I'll add that.

Parent comment

AN

I like this. The proxy app works better for me if I change the call to etree.tostring to: etree.tostring(page, pretty_print=True, method='html') Which *seems* to stop it from truncating tags so the CLOSING_REGEX replacement isn't required.