外賣訂單爬蟲 定時自動抓取三大外賣平臺上商家訂單
阿新 • • 發佈:2019-01-06
這個程式是用來抓取外賣平臺(美團,餓了麼,百度)的商戶訂單開發,並不是一個通用庫,而是為這個特定場景進行開發的。
適用場景:餐飲企業擁有多家外賣門店,訂單量非常大,有對訂單進行資料分析的需求。
主要功能:每天定時啟動,抓取三大外賣平臺的訂單,轉成成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服務使用的是聚合資料的 驗證碼識別API服務,你需要先申請聚合資料的賬號,得到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":"程式使用的郵件的密碼"
},