外賣訂單爬蟲(美團,餓了么,百度外賣)


這個程序是用來抓取外賣平台(美團,餓了么,百度)的商戶訂單開發,並不是一個通用庫,而是為這個 特定場景進行開發的。 適用場景:餐飲企業擁有多家外賣門店,訂單量非常大,有對訂單進行數據分析的需求。 主要功能:每天定時啟動,抓取三大外賣平台的訂單,轉成成excel文件,發郵件給需要的人

如何使用

修改config目錄下的production.json

{
  "log": {
    "level": "DEBUG"
  },
  "mail": {
    "from": "company@xxx.com", //郵件發送人
    "mailTo": "di.mu@xxx.com", //郵件接收人
    "host":"smtp.xxx.com",
    "port":25,
    "secure":false,
    "user":"company@xxx.com",  //程序使用的郵件
    "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服務使用的是聚合數據的驗證碼識別服務,你需要先 申請聚合數據的賬號,得到key 填寫到如下配置項中去。

"imgCode":{
    "key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"   // https://www.juhe.cn/docs/api/id/60  識別驗證碼api的key
  },

郵件功能需要配置詳細的smtp服務地址、發件人賬號名、密碼、端口、是否使用ssl

"mail": {
    "from": "company@xxx.com", //郵件發送人
    "mailTo": "di.mu@xxx.com", //郵件接收人
    "host":"smtp.xxx.com",
    "port":25,
    "secure":false,
    "user":"company@xxx.com",  //程序使用的郵件
    "pass":"程序使用的郵件的密碼"
  },

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM