STRIP TAGS AND JAVASCRIPT FROM HTML PAGE, LEAVING ONLY SAFE TAGS (PYTHON RECIPE)
URL: http://code.activestate.com/recipes/52281/ Sometimes we are getting HTML input from the user. We want to only allow valid, undangerous tags, we want all tags to be balanced (i.e. an unclosed will leave all text on your page bold), and we want to strip out all Javascript. This recipe demonstrates how to do this using the sgmllib parser to parse HTML. Python, 59 lines Download import sgmllib,..
Devolopment/Python
2020. 3. 17. 14:35
반응형
최근에 달린 댓글