Skip to main content

Taiwan Lottery Crawler 台灣彩券爬蟲

Project description

Taiwan Lottery Crawler

License: MIT Test Status PRs Welcome

這個專案是用來爬取 台灣彩券 官網上歷史的開獎紀錄,目前支援威力彩大樂透今彩539雙贏彩 4 種彩券遊戲。

Features

  • 爬取 威力彩、大樂透、今彩539、雙贏彩 4 種彩券遊戲的開獎紀錄。
  • 爬取結果可直接輸出產生成 json 格式檔案進行後續使用。
  • 針對單一的彩券遊戲可以爬取幾個月前的開獎紀錄。

Requirements

Install

git clone https://github.com/stu01509/TaiwanLotteryCrawler.git
cd TaiwanLotteryCrawler
pip install -r requirements.txt

Build

python setup.py sdist bdist_wheel

Publish

pip install twine
twine check .\dist\*
twine upload .\dist\*

Command

爬取當月份的開獎紀錄

python crawl.py

爬取當月份的開獎紀錄並輸出 JSON

python crawl.py -o

往回爬取指定彩券的幾個月前的開獎紀錄

爬取 5 個月前的開獎資料

python crawl.py 威力彩 -b 5
python crawl.py 大樂透 -b 5
python crawl.py 今彩539 -b 5
python crawl.py 雙贏彩 -b 5

往回爬取指定彩券的幾個月前的開獎紀錄並輸出 JSON

爬取 5 個月前的開獎資料並輸出 JSON

python crawl.py 威力彩 -b 5 -o
python crawl.py 大樂透 -b 5 -o
python crawl.py 今彩539 -b 5 -o
python crawl.py 雙贏彩 -b 5 -o

爬取指定彩券的年月的開獎紀錄

爬取 2020 年 4 月份的開獎紀錄

python crawl.py 威力彩 -t 2020-04
python crawl.py 大樂透 -t 2020-04
python crawl.py 今彩539 -t 2020-04
python crawl.py 雙贏彩 -t 2020-04

爬取指定彩券的年月的開獎紀錄並輸出 JSON

爬取 2020 年 4 月份的開獎紀錄並輸出 JSON

python crawl.py 威力彩 -t 2020-04 -o
python crawl.py 大樂透 -t 2020-04 -o
python crawl.py 今彩539 -t 2020-04 -o
python crawl.py 雙贏彩 -t 2020-04 -o

指令說明

python crawl.py -h

Data Source

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

taiwanlottery-0.0.2-py3-none-any.whl (11.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page