def get_img(html): p = r'src="(https://img.*?\.jpg)"pic_ext' imgsa = re.compile(p) imglist = re.findall(imgsa,html)
收起
html不是字符串 用print(type(html)) 输出下看看html是什么类型 转换成字符串
报告相同问题?