报错:
Traceback (most recent call last):
File "/Users/q/Desktop/python/python16.py", line 40, in <module>
b=re.findall(".*>系统要求(.*)</p>.*",response)
File
"/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/re.py",
line 241, in findall
return _compile(pattern, flags).findall(string)
TypeError: expected string or bytes-like object
究其原因:
re.findall()第二个参数需要字符串类型,但是response的返回值不是字符串,需要str()转换一下。
修改:
b=re.findall(".*>系统要求(.*)</p>.*",str(response))