TypeError: 'str' object is not callable
str( )是python自带函数,是python保留的关键字,定义变量时应该避免使用str作为变量名
如果在使用str( )函数之前已经定义过str变量,
则会出现TypeError: ‘str’ object is not callable这个报错
UnicodeEncodeError: 'gbk' codec can't encode character '\xa9' in position 364151: illegal multibyte sequence
#写入文件
#输出时指定目标文件的编码
r = requests.get('https://www.***.com/')
fo = open("./download/***.html", "a+", encoding='utf-8')
fo.write(r.text)