奥尔覅几22 发表于 2018-8-9 06:59:35

python3 urllib用法

import urllib  
data = urllib.parse.urlencode(params).encode('utf-8')
  
req = urllib.request.Request(url, data)
  
req.add_header('Content-Type', "application/x-www-form-urlencoded")
  
response = urllib.request.urlopen(req)
  
the_page = response.read().decode('utf-8')
  
print(the_page)
页: [1]
查看完整版本: python3 urllib用法