程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python crawler series: collection of bubble Mart stores nationwide

編輯:Python

Python Crawler series: collection of bubble Mart stores nationwide

If you have any questions > Click here to communicate with me <

Please scan the QR code below for wechat

To maintain the green and healthy development of the network , Related encryption hidden , The code is for learning and communication only , Do not use for illegal purposes

Go straight to the code

# -*- coding:utf-8 -*-
import hashlib
import time
import json
import random
import requests
import urllib.parse
from sign import getTracrId, getParams
def getStoreList(city, page):
url = "https://popvip-go.paquapp.com/miniapp/v********"
data = {
"city": city, "lon": 125.96641540527344, "page_num": int(page),
"parent_type": 0, "openid": "o*******************"}
data = getParams(data)
trace_id = getTracrId(data, url)
headers = {

"identity_code": "o*******************",
"User-Agent": "Mozilla/5.0 (iPad; CPU OS 12_4_8 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.13(0x18000d37) NetType/WIFI Language/zh_CN",
"trace_id": trace_id,
}
resp = requests.post(url, data=data, headers=headers)
print(resp.json())
def getStoreListDemo():
city = " Qingdao "
page = 1
getStoreList(city, page)
def getCityListDemo():
url = "https://popvip-go.paquapp.com/miniapp/********ies"
data = {

"openid": "o*******************"
}
data = getParams(data)
trace_id = getTracrId(data, url)
headers = {

"User-Agent": "Mozilla/5.0 (iPad; CPU OS 12_4_8 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.13(0x18000d37) NetType/WIFI Language/zh_CN",
"trace_id": trace_id,
}
res = requests.get(url, params=data, headers=headers)
print(res.json())
def main():
# Get a list of cities
getCityListDemo()
# Get a list of stores
getStoreListDemo()
if __name__ == '__main__':
main()

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved