import requests
import json
import jsonpath
from concurrent.futures import ThreadPoolExecutor
print("名称\t最高价\t平均价\t最低价")
f = open("北京新发地菜价.txt","w")
def main(current):
url = "http://www.xinfadi.com.cn/getPriceData.html"
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"}
data = {"limit": "20",
"current": f"{current+1}",
"pubDateStartTime":"",
"pubDateEndTime":"" ,
"prodPcatid":"",
"prodCatid":"" ,
"prodName": ""}
parsePrint(url,headers,data)
def parsePrint(url,headers,data):
res = requests.post(url,headers=headers,data=data)
jsonbj = json.loads(res.text)
Python爬虫_线程池实例——北京新发地菜价
最新推荐文章于 2024-06-02 21:02:46 发布