python requests get传参

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)
相关文章
相关标签/搜索