Coder Social home page Coder Social logo

e-tracking's Introduction

GitHub release

E-Tracking

統一超商交貨便貨態查詢(包含 OCR 自動辨識驗證碼)

Install

  1. 下載本 source code
  2. 安裝必要套件
    pip install -r requirements.txt
  3. 安裝 tesseract (如需使用 OCR 自動辨識)
    Linux 安裝 tesseract
    Windows 安裝 tesseract

API Reference

  • ECTracker(tesseract_path='tesseract'): [class]
    • tesseract_path: [str] 設定 tesseract 路徑 (default: tesseract)
  • ECTracker.tracker(txtProductNum, autoVerify=False, tesseract_path='tesseract'): [function]
    • txtProductNum: [str] 貨態號碼 詳細請至貨態號碼查詢教學查看
    • autoVerify: [Boolean] 是否啟用 OCR 自動辨識驗證碼 (default: False)

Use

# import ECTracker class
from .etracking import ECTracker
ECTRACKER = ECTracker(tesseract_path='path_of_tesseract/tesseract')
# ECTRACKER.tracker('txtProductNum', autoVerify=True)
print(ECTRACKER.tracker('F45913208600', autoVerify=True))
# Return message (type is dictionary)
{   
    '取貨門市': '仁東', 
    '取貨門市地址': '高雄市岡山區大仁北路175號1樓', 
    '取貨截止日': '2020-04-15', 
    '付款資訊': '取貨付款', 
    '貨態資訊': [
        '2020/04/06 18:30 交貨便訂單已成立,尚未至門市寄貨', 
        '2020/04/06 19:35 門市已收件', 
        '2020/04/07 02:16 包裹已送往物流中心', 
        '2020/04/07 07:35 包裹已送達物流中心,進行理貨中', 
        '2020/04/07 14:09 包裹等待配送中', 
        '2020/04/08 04:25 包裹配達門市', 
        '2020/04/08 16:57 已完成包裹成功取件'
    ]
}

Error

使用 OCR 自動判斷驗證碼錯誤時將拋出例外: VerifyError
請自行進行例外處理(重新執行至正確或中斷)

e-tracking's People

Contributors

dependabot[bot] avatar thanatosdi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

e-tracking's Issues

OCR 自動辨識驗證碼時遇到的問題

Hi,我自己有實作一套用爬蟲配 Tesseract 的物流碼追蹤系統,但我在 OCR 遇到了點問題,想請問您這邊有沒有遇到?
我這邊在把圖片抓下來並做影像辨識的時候,會出現抓下來的圖片跟實際瀏覽器所看到的驗證碼不同的問題,有點像是抓驗證碼圖片與瀏覽器是不同時間去開啟網頁,造成驗證碼不一致,但理論上應該是要同一張才對,而且通常第一次會成功,但後面幾次就不行了,目前還不曉得問題在哪裡。
我自己的程式碼也有在 GitHub 上,如果我的問題說明不夠清楚的話,也可以參考看看 🙏

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.