https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Simplifying_HTML_by_removing_%22invisible%22_parts&feed=atom&action=historySimplifying HTML by removing "invisible" parts - Revision history2024-03-28T14:20:52ZRevision history for this page on the wikiMediaWiki 1.38.2https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Simplifying_HTML_by_removing_%22invisible%22_parts&diff=11289&oldid=prevAymeric Mansoux: Created page with "Use lxml to simplify an HTML page <source lang="python"> import lxml.html.clean lxml.html.clean.clean_html(source) </source> example: <nowiki> lxml.html.clean.clean_html("<htm..."2011-03-16T11:36:39Z<p>Created page with "Use lxml to simplify an HTML page <source lang="python"> import lxml.html.clean lxml.html.clean.clean_html(source) </source> example: <nowiki> lxml.html.clean.clean_html("<htm..."</p>
<p><b>New page</b></p><div>Use lxml to simplify an HTML page<br />
<br />
<source lang="python"><br />
import lxml.html.clean<br />
lxml.html.clean.clean_html(source)<br />
</source><br />
<br />
example:<br />
<nowiki><br />
lxml.html.clean.clean_html("<html><head><title>Hello</title><script>var foo=3;</script></head><body><p>This is <u>some crazy text</u>. OK!</body></html>")<br />
</nowiki><br />
<br />
result:<br />
<br />
'<div>Hello<body><p>This is <u>some crazy text</u>. OK!</p></body></div>'</div>Aymeric Mansoux