KFC门店定点查询(输入城市名称即可查询)

KFC定点查询(输入城市名称即可查询)

KFC门店定点查询(输入城市名称即可查询)_第1张图片

import requests
from lxml import etree
import time
url = 'http://www.kfc.com.cn/kfccda/ashx/GetStoreList.ashx?op=keyword'
city = input("Please enter the city:")
data = {
    "cname": "",
    "pid":"", 
    "keyword": city,
    "pageIndex": "1",
    "pageSize": "10",
}
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36"
}
response = requests.post(url=url,headers=headers,data=data).json()
response

你可能感兴趣的:(spider大集合,python,json,post,爬虫,大数据)