GithubHelp home page GithubHelp logo

hhy5277 / meituanappspider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hahaha108/meituanappspider

0.0 1.0 0.0 20.71 MB

美团APP爬虫,可获取指定城市范围内所有美食店铺信息,包含店铺名称、类别、评分、所属片区、经纬度、详细地址、优惠套餐情况、营业时间、联系电话、累计售出份数、餐厅简介、特色菜......

Python 100.00%

meituanappspider's Introduction

meituanAppSpider

美团APP爬虫,可获取指定城市范围内所有美食店铺信息,包含店铺名称、类别、评分、所属片区、经纬度、详细地址、优惠套餐情况、营业时间、联系电话、累计售出份数、餐厅简介、特色菜......
可指定存储方式,有txt,csv,mysql数据库三种方式可供选择

一、使用方法

可参照run.py
1.创建一个MT_spider,可指定存储模式,默认为txt

spider = MT_spider(save_mode='csv')

2.调用run方法

spider.run()

二、注意事项

1.默认设置有随机2~5秒爬取间隔,建议不要修改
2.若有需要文件存储名称、路径以及数据库设置项可在settings.py中修改
3.默认爬取城市为深圳,由于美团APP的api中城市信息根据id传输,若要修改城市,只需修改spider.py下base_url中city/后面的数字即可

http://api.meituan.com/group/v4/deal/select/city/30/cate/1?sort=solds&hasGroup=true&mpt_cate1=1&offset={0}&limit=100

1为北京,10为上海,20为广州,30为深圳,253为襄阳,其他的可抓包获取

三、结果

美团美食商家:深圳23540家;北京24964家;上海28380家;广州21709家;而襄阳只有2851家....
各地的美食偏好情况分析:
1.深圳:最爱牛肉、牛肉丸、三文鱼、豆腐、水果
2.北京:最爱牛肉、五花肉、三文鱼、酸梅汤、羊蝎子、宫保鸡丁
3.上海:最爱三文鱼、牛肉、酸菜鱼、红烧肉、提拉米苏
4.襄阳:表示四线小城市没吃过三文鱼这种高端产品,不过牛肉还是不错的,还有火锅、干锅什么的也很nice

本程序仅供编程学习之用,请勿用于商业

meituanappspider's People

Contributors

hahaha108 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.