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是什么类型转换成字符串