|
post请求和get请求相比只不过多了一个参数,有data就是post没有就是get
import urllib.request
POST方式
req=urllib.request.Request(url=url,headers=headers,data=params)
response = urllib.request.urlopen(req)
html = response.read().decode('utf-8', 'ignore')
GET方式
response = urllib.request.urlopen(url)
html = response.read().decode('utf-8', 'ignore') |
|