python3.5过滤网址和图片的函数自己亲测可用

def has_replace(tag):
         #过滤网址
        real=re.sub(r'<ashref=.+</a>', '',tag.decode(), count=0, flags=0)
        real=re.sub(r'<imgsalt.+/>', '',real, count=0, flags=0)
        return real

写的比较简单,没事的朋友可以继续写个更详细的
记得要 import re
原文地址:https://www.cnblogs.com/baker95935/p/7754987.html