Is there an Open Source Python library for sanitizing HTML and removing all Javascript? -


I want to write a web application that allows users to enter any HTML that is Lt; Div & gt; Element then this HTML is being displayed to other users, so I want to make sure the site does not open up to XSS attacks.

Is there a good library in Python that will clean all the events controller from HTML or DOM tree, & lt; Script & gt; Elements and other Javascript Crraft?

I intend to use the beautiful soup to regularize the HTML to ensure this does not have an attached tag and in such a way but, as far as I can tell, all javascript There is no pre-packed approach to touch.

If there is a good library in any other language, then she can do the work, but I will really like Python.

I have searched a bunch of Google and have hunted on PP, but nothing has been clarified.

Related

Whitelist's approach to approved tags, attributes and their values ​​is the only reliable way.

What is wrong with existing markup languages ​​used on this site?


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -