import requests
url = 'https://api.meituan.com/ptapi/smart-suggest/classify/homepage?cityId=1&keyword=美食'
response = requests.get(url)
if response.status_code == 200:
data = response.json()
# 解析返回的数据
# ...
else:
print('请求失败,状态码:', response.status_code)
在实际的采集过程中,你可能需要根据需要调用多个接口,并对返回的数据进行处理和存储。你还可以使用其他工具和库来帮助你进行数据处理、存储和分析,例如Python的pandas库和数据库等。
需要注意的是,如果你打算对美团进行大规模的数据采集,你可能需要考虑其他方面,如接口限流、登录问题等。在进行任何采集操作时,请遵守美团的相关规定和政策,以确保合法合规地进行数据采集操作。
java请求实例
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"longitude\":\"106.54160755578363\",\"latitude\":\"29.58238498591598\",\"cityId\":45,\"currentLongitude\":\"106.54160755578363\",\"currentLatitude\":\"29.58238498591598\",\"uuid\":\"\",\"pageNum\":2,\"pageSize\":20,\"requestSourceType\":1,\"keyword\":\"\",\"filterParam\":{},\"queryId\":\"\",\"searchId\":\"\"}");
Request request = new Request.Builder()
.url("https://sqt.meituan.com/daocan/poi/queryPoiList?yodaReady=h5&csecplatform=4&csecversion=2.4.0")
.method("POST", body)
.addHeader("Cookie", "")
.addHeader("User-Agent", "Apifox/1.0.0 (https://apifox.com)")
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "*/*")
.addHeader("Host", "sqt.meituan.com")
.addHeader("Connection", "keep-alive")
.build();
Response response = client.newCall(request).execute();
c#
var client = new RestClient("https://sqt.meituan.com/daocan/poi/queryPoiList?yodaReady=h5&csecplatform=4&csecversion=2.4.0");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Cookie", "");
client.UserAgent = "Apifox/1.0.0 (https://apifox.com)";
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "*/*");
request.AddHeader("Host", "sqt.meituan.com");
request.AddHeader("Connection", "keep-alive");
var body = @"{""longitude"":""106.54160755578363"",""latitude"":""29.58238498591598"",""cityId"":45,""currentLongitude"":""106.54160755578363"",""currentLatitude"":""29.58238498591598"",""uuid"":"""",""pageNum"":2,""pageSize"":20,""requestSourceType"":1,""keyword"":"""",""filterParam"":{},""queryId"":"""",""searchId"":""""}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Python
import http.client
import json
conn = http.client.HTTPSConnection("sqt.meituan.com")
payload = json.dumps({
"longitude": "106.54160755578363",
"latitude": "29.58238498591598",
"cityId": 45,
"currentLongitude": "106.54160755578363",
"currentLatitude": "29.58238498591598",
"uuid": "",
"pageNum": 2,
**自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。**
**深知大多数Python工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!**
**因此收集整理了一份《2024年Python开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。**
![img](https://img-blog.csdnimg.cn/img_convert/17efc7b11cdfbf0f07640c1343f96b01.png)
![img](https://img-blog.csdnimg.cn/img_convert/64d1b405721b786b5a1f5987cf444469.png)
![img](https://img-blog.csdnimg.cn/img_convert/46506ae54be168b93cf63939786134ca.png)
![img](https://img-blog.csdnimg.cn/img_convert/252731a671c1fb70aad5355a2c5eeff0.png)
![img](https://img-blog.csdnimg.cn/img_convert/6c361282296f86381401c05e862fe4e9.png)
![img](https://img-blog.csdnimg.cn/img_convert/9f49b566129f47b8a67243c1008edf79.png)
**既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!**
**由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新**
**如果你觉得这些内容对你有帮助,可以扫码获取!!!(备注Python)**
较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新**
**如果你觉得这些内容对你有帮助,可以扫码获取!!!(备注Python)**
<img src="https://img-community.csdnimg.cn/images/fd6ebf0d450a4dbea7428752dc7ffd34.jpg" alt="img" style="zoom:50%;" />