数据处理
import urllib.request import urllib.parse headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36' } url = urllib.request.Request('https://movie.douban.com/',headers=headers) data = { 'value':'true', } # 数据处理 data = urllib.parse.urlencode(data).encode('utf-8') req = urllib.request.urlopen(url,data=data) print(req.read())