Extracts html contents by preserving ancestors and clean CSS