按照教程来的,教程上面都没有出现问题,结果我写下来就出现错误了。
#coding=utf-8
import requests
from bs4 import BeautifulSoup
url='https://www.qidian.com/rank/hotsales/'
headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36'}
response=requests.get(url,headers=headers)
print(response.text)
UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 39362: illegal multibyte sequence