V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
jiane
V2EX  ›  互联网

外卖订单爬虫(美团,饿了么,百度外卖)

  •  
  •   jiane · 2016-12-19 15:15:14 +08:00 · 2457 次点击
    这是一个创建于 2682 天前的主题,其中的信息可能已经有所发展或是发生改变。

    这个程序是用来抓取外卖平台(美团,饿了么,百度)的商户订单开发,并不是一个通用库,而是为这个 特定场景进行开发的。 适用场景:餐饮企业拥有多家外卖门店,订单量非常大,有对订单进行数据分析的需求。 主要功能:每天定时启动,抓取三大外卖平台的订单,转成成 excel 文件,发邮件给需要的人

    如何使用

    修改 config 目录下的 production.json

    {
      "log": {
        "level": "DEBUG"
      },
      "mail": {
        "from": "[email protected]", //邮件发送人
        "mailTo": "[email protected]", //邮件接收人
        "host":"smtp.xxx.com",
        "port":25,
        "secure":false,
        "user":"[email protected]",  //程序使用的邮件
        "pass":"程序使用的邮件的密码"
      },
      "imgCode":{
        "key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"   // https://www.juhe.cn/docs/api/id/60  识别验证码 api 的 key
      },
      "account": [
        {
          "name": "美团 xxx 店",
          "username": "帐户名",
          "password": "账户密码",
          "type": "meituan"
        },
        {
          "name": "饿了么 xxx 店",
          "username": "帐户名",
          "password": "账户密码",
          "type": "eleme"
        },
        {
          "name": "百度 xxx 店",
          "username": "帐户名",
          "password": "账户密码",
          "type": "baidu"
        }
      ]
    }
    

    其中以下配置是程序中使用验证码识别的 api 服务, 美团,百度的商家后台都需要验证码登录 api 服务使用的是聚合数据的验证码识别服务: https://www.juhe.cn/docs/api/id/60 你需要申请聚合数据的账号,得到 key 填写到如下配置项中去。

    "imgCode":{
        "key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"   // https://www.juhe.cn/docs/api/id/60  识别验证码 api 的 key
      },
    

    邮件功能需要配置详细的 smtp 服务地址、发件人账号名、密码、端口、是否使用 ssl

    "mail": {
        "from": "[email protected]", //邮件发送人
        "mailTo": "[email protected]", //邮件接收人
        "host":"smtp.xxx.com",
        "port":25,
        "secure":false,
        "user":"[email protected]",  //程序使用的邮件
        "pass":"程序使用的邮件的密码"
      },
    

    GitHub 地址: https://github.com/mudiyouyou/waimai-crawler

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3285 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 13:45 · PVG 21:45 · LAX 06:45 · JFK 09:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.