python3 報錯這個TypeError: expected string or bytes-like object如何解決

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