import requests
import re
obj=re.compile(r'iframe src="(?P<urls>.*?)" width',re.S)
url='http://www.wwmulu.com/rj/zldzf/play-1-1.html'
resp=requests.get(url)
resp.encoding='utf-8'
m3u8_url=obj.search(resp.text).group('urls')
print(m3u8_url)
提示:AttributeError: 'NoneType' object has no attribute 'group'