近期接的一个需求需要去除图片的红章,用到了PIL库. from PIL import Image,ImageEnhanceimport os#f="5-12 - 0001.tif" for rt, dirs, files in os.walk("D:\工作文件夹\OCR\pictest"): for f in files: fname = os.path.splitext(f) newName = fname[0] + '_nostamp' + fname[1] i…
去除指定标签 from bs4 import BeautifulSoup #去除属性ul [s.extract() for s in soup("ul")] # 去除属性svg [s.extract() for s in soup("svg")] # 去除属性script [s.extract() for s in soup("script")] 去除注释 from bs4 import BeautifulSoup, Comment #去除注释…