赞
踩
大家早好、午好、晚好吖 ❤ ~欢迎光临本文章
今天介绍一下如何用 Python 来批量获取京东商品信息!!
python 3.8
pycharm 专业版
一. 思路分析
找到数据来源 (找到 数据所在的链接地址)
https://api.m.jd.com/?appid=search-pc-java&functionId=pc_search_s_new&client=pc&clientVersion=1.0.0&t=1697545127305&body=%7B%22keyword%22%3A%22iPhone%22%2C%22qrst%22%3A%221%22%2C%22wq%22%3A%22iPhone%22%2C%22ev%22%3A%22exbrand_Apple%5E%22%2C%22pvid%22%3A%22c2a8f09dbfa044a6a12f860e20edb6c7%22%2C%22isList%22%3A0%2C%22page%22%3A%223%22%2C%22s%22%3A%2256%22%2C%22click%22%3A%220%22%2C%22log_id%22%3A%221697544397338.9790%22%2C%22show_items%22%3A%22%22%7D&loginType=3&uuid=122270672.1675327822068798256204.1675327822.1696749738.1697544369.7&area=18_1482_48942_49058&h5st=20231017201847323%3Bg5giig9tnm63gij2%3Bf06cc%3Btk03wbde31c7218nmTOuI4vmUG1gibUwyDKLNpF6B_t1uk9ukpSq3k_k19h74PyUWE_Fz9mV-ggz4JCtsVbQZVSId9dC%3B7710a41bb85a10fe65109f794fb3b815%3B4.1%3B1697545127323%3Bee3cf7f6b94dc20e9265d83066bb9ceece4bb89e2b7e8bf5afb1bfd928788174bfa06c210ddd4437d8a2e234330c3a3980b96c3953b1ab788029ae792b39e113ccac142f09e3a1fa8c3f25055353b835ed0bf65228424626b8a9e1d2c030999d9be97a9dee9fb20116ceb0deb8736546109bc1cf5b91d1dfa2b39c79b3b0f0a5a036cdc921a1f147179b291c830dc87a6d3d0c3885fe721d5f0391a55bb4bf663963282084e04c7f24e6d3bcb219f4cbb08d3f76f13bca81938336d1934b88ded260caabac20e37a63dd3f6a093fd5dd2d936e95b67fee9654732d8a2908d96fe4b8d0a0b9d9b65996563d4cb94925fd651106c8e7c1234f63f57b1baa40324d6e8969e5c7b48e35e2c4bc5d325e88db237e42c33d6b256ebc720e76f574f34b&x-api-eid-token=jdd03BFXLLB72GO2GWA4OW3JSYXJPOVRF3WAKAKETOTSMNISZ6VIJTLEVQKEHWUA6VLD7ORS2QYC55PWBVUZVPZTXPDCHZUAAAAMLHWDXLUYAAAAACL4BJCT4CQASEEX
二. 代码实现
发送请求 (访问网站)
提取数据 将需要的内容提取出来
保存数据
详情页: 评论数量 销量 商品介绍 店铺评分
翻页抓取: 如何实现翻页抓取
一页分为两部分加载 每个部分 30条数据
翻页的规律:
第二页的第一个包和第二个包的对比
t: 1697545127305
2-1-body: {
&#
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。