GET传参方式一: import requestsurl = ‘ http://www.baidu.com/s?page=2 ‘ # 使用?携带参数r = requests. get (url)print(r.url) GET传参方式二: import requestsurl = ‘ http://www.baidu.com/s ‘ data = { ‘ page ‘ : ‘
GET传参方式一:
import requests url = ‘http://www.baidu.com/s?page=2‘ # 使用?携带参数 r = requests.get(url) print(r.url)
GET传参方式二:
import requests url = ‘http://www.baidu.com/s‘ data= {‘page‘: ‘2‘} #将携带的参数传给params r = requests.get(url, params=data) print(r.url)