import requests
# ?可加可不加
url = 'http://www.baidu.com/s?'
headers = {
'Cookie': '',
'User-Agent': '',
}
data = {
'wd': '北京'
}
# params 参数
response = requests.get(url=url, params=data, headers=headers)
content = response.text
print(content)
总结: