taiwanlottery


Nametaiwanlottery JSON
Version 1.5.1 PyPI version JSON
download
home_page
SummaryTaiwan Lottery Crawler 台灣彩券爬蟲
upload_time2024-01-04 14:26:50
maintainer
docs_urlNone
authorCliff Su
requires_python>=3.6
licenseMIT
keywords python taiwanlottery crawler lottery taiwan 台灣彩券 樂透 彩券
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Taiwan Lottery Crawler

[![PyPI](https://img.shields.io/pypi/v/taiwanlottery)](https://pypi.org/project/taiwanlottery/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/taiwanlottery)](https://pypi.org/project/taiwanlottery/)
[![CI Status](https://github.com/stu01509/TaiwanLotteryCrawler/actions/workflows/ci.yaml/badge.svg)](https://github.com/stu01509/TaiwanLotteryCrawler/actions/workflows/ci.yaml)
[![codecov](https://codecov.io/gh/stu01509/TaiwanLotteryCrawler/branch/master/graph/badge.svg?token=AX0LW032B4)](https://codecov.io/gh/stu01509/TaiwanLotteryCrawler)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=stu01509_TaiwanLotteryCrawler&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=stu01509_TaiwanLotteryCrawler)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=stu01509_TaiwanLotteryCrawler&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=stu01509_TaiwanLotteryCrawler)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=stu01509_TaiwanLotteryCrawler&metric=bugs)](https://sonarcloud.io/summary/new_code?id=stu01509_TaiwanLotteryCrawler)
![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)

## 介紹

這個專案是用來爬取 [台灣彩券](https://www.taiwanlottery.com.tw/) 官網上歷史的開獎紀錄,目前支援**威力彩**、**大樂透**、**今彩539**、**雙贏彩**、**3星彩**、**4星彩**、**38樂合彩**、**39樂合彩**、**49樂合彩** 9 種彩券遊戲。

## 功能

- 爬取威力彩、大樂透、今彩539、雙贏彩、3星彩、4星彩、38樂合彩、39樂合彩、49樂合彩 9 種彩券遊戲的開獎紀錄。

## 環境需求

Python >= 3.6

## 安裝

```shell
pip install taiwanlottery
```

## 範例

### 爬取當月份的開獎紀錄

[威力彩](https://codesandbox.io/p/sandbox/dark-breeze-r2yfsf?file=%2Fmain.py%3A6%2C1)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.super_lotto()
print(result)
```

[大樂透](https://codesandbox.io/p/sandbox/wei-li-cai-dang-yue-fen-de-kai-jiang-ji-lu-forked-rt67ty)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto649()
print(result)
```

[今彩539](https://codesandbox.io/p/sandbox/da-le-tou-dang-yue-fen-de-kai-jiang-ji-lu-forked-n5t886)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.daily_cash()
print(result)
```

[雙贏彩](https://codesandbox.io/p/sandbox/da-le-tou-dang-yue-fen-de-kai-jiang-ji-lu-forked-vmlhst)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto1224()
print(result)
```

[3星彩](https://codesandbox.io/p/sandbox/3xing-cai-dang-yue-fen-de-kai-jiang-ji-lu-vsxs3p)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto3d()
print(result)
```

[4星彩](https://codesandbox.io/p/sandbox/4xing-cai-dang-yue-fen-de-kai-jiang-ji-lu-3pwkfk)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto4d()
print(result)
```

[38樂合彩](https://codesandbox.io/p/sandbox/38le-he-cai-dang-yue-fen-de-kai-jiang-ji-lu-yfphxf)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto38m6()
print(result)
```

[39樂合彩](https://codesandbox.io/p/sandbox/39le-he-cai-dang-yue-fen-de-kai-jiang-ji-lu-mgqwfg)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto39m5()
print(result)
```

[49樂合彩](https://codesandbox.io/p/sandbox/49le-he-cai-dang-yue-fen-de-kai-jiang-ji-lu-jgy94n)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto49m6()
print(result)
```

---

### 爬取指定年月的開獎紀錄(YYYY-MM)

[威力彩](https://codesandbox.io/p/sandbox/da-le-tou-dang-yue-fen-de-kai-jiang-ji-lu-forked-ksq74y)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.super_lotto(['2023', '06'])
print(result)
```

[大樂透](https://codesandbox.io/p/sandbox/wei-li-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-forked-lqcfht)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto649(['2023', '06'])
print(result)
```

[今彩539](https://codesandbox.io/p/sandbox/wei-li-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-forked-ntvjp7)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.daily_cash(['2023', '06'])
print(result)
```

[雙贏彩](https://codesandbox.io/p/sandbox/wei-li-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-forked-22dtrx)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto1224(['2023', '06'])
print(result)
```

[3星彩](https://codesandbox.io/p/sandbox/3xing-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-vsfvlx)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto3d(['2023', '08'])
print(result)
```

[4星彩](https://codesandbox.io/p/sandbox/4xing-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-r8fpxq)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto4d(['2023', '08'])
print(result)
```

[38樂合彩](https://codesandbox.io/p/sandbox/38le-he-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-m4s9jn)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto38m6(['2023', '08'])
print(result)
```

[39樂合彩](https://codesandbox.io/p/sandbox/39le-he-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-lskqmm)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto39m5(['2023', '08'])
print(result)
```

[49樂合彩](https://codesandbox.io/p/sandbox/49le-he-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-ff6d5d)

```python
from TaiwanLottery import TaiwanLotteryCrawler

lottery = TaiwanLotteryCrawler()
result = lottery.lotto49m6(['2023', '08'])
print(result)
```

## 資料來源

- [https://www.taiwanlottery.com/lotto/history/history_result/](https://www.taiwanlottery.com/lotto/history/history_result/)

## License

MIT License

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "taiwanlottery",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "python,taiwanlottery,crawler,lottery,taiwan,\u53f0\u7063\u5f69\u5238,\u6a02\u900f,\u5f69\u5238",
    "author": "Cliff Su",
    "author_email": "stu01509@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c8/b8/ad94793a14b599d4e7ac605503390841090b35ea48bbcdcd9071ce2f04cc/taiwanlottery-1.5.1.tar.gz",
    "platform": "unix",
    "description": "# Taiwan Lottery Crawler\n\n[![PyPI](https://img.shields.io/pypi/v/taiwanlottery)](https://pypi.org/project/taiwanlottery/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/taiwanlottery)](https://pypi.org/project/taiwanlottery/)\n[![CI Status](https://github.com/stu01509/TaiwanLotteryCrawler/actions/workflows/ci.yaml/badge.svg)](https://github.com/stu01509/TaiwanLotteryCrawler/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/stu01509/TaiwanLotteryCrawler/branch/master/graph/badge.svg?token=AX0LW032B4)](https://codecov.io/gh/stu01509/TaiwanLotteryCrawler)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=stu01509_TaiwanLotteryCrawler&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=stu01509_TaiwanLotteryCrawler)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=stu01509_TaiwanLotteryCrawler&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=stu01509_TaiwanLotteryCrawler)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=stu01509_TaiwanLotteryCrawler&metric=bugs)](https://sonarcloud.io/summary/new_code?id=stu01509_TaiwanLotteryCrawler)\n![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)\n![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)\n\n## \u4ecb\u7d39\n\n\u9019\u500b\u5c08\u6848\u662f\u7528\u4f86\u722c\u53d6 [\u53f0\u7063\u5f69\u5238](https://www.taiwanlottery.com.tw/) \u5b98\u7db2\u4e0a\u6b77\u53f2\u7684\u958b\u734e\u7d00\u9304\uff0c\u76ee\u524d\u652f\u63f4**\u5a01\u529b\u5f69**\u3001**\u5927\u6a02\u900f**\u3001**\u4eca\u5f69539**\u3001**\u96d9\u8d0f\u5f69**\u3001**3\u661f\u5f69**\u3001**4\u661f\u5f69**\u3001**38\u6a02\u5408\u5f69**\u3001**39\u6a02\u5408\u5f69**\u3001**49\u6a02\u5408\u5f69** 9 \u7a2e\u5f69\u5238\u904a\u6232\u3002\n\n## \u529f\u80fd\n\n- \u722c\u53d6\u5a01\u529b\u5f69\u3001\u5927\u6a02\u900f\u3001\u4eca\u5f69539\u3001\u96d9\u8d0f\u5f69\u30013\u661f\u5f69\u30014\u661f\u5f69\u300138\u6a02\u5408\u5f69\u300139\u6a02\u5408\u5f69\u300149\u6a02\u5408\u5f69 9 \u7a2e\u5f69\u5238\u904a\u6232\u7684\u958b\u734e\u7d00\u9304\u3002\n\n## \u74b0\u5883\u9700\u6c42\n\nPython >= 3.6\n\n## \u5b89\u88dd\n\n```shell\npip install taiwanlottery\n```\n\n## \u7bc4\u4f8b\n\n### \u722c\u53d6\u7576\u6708\u4efd\u7684\u958b\u734e\u7d00\u9304\n\n[\u5a01\u529b\u5f69](https://codesandbox.io/p/sandbox/dark-breeze-r2yfsf?file=%2Fmain.py%3A6%2C1)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.super_lotto()\nprint(result)\n```\n\n[\u5927\u6a02\u900f](https://codesandbox.io/p/sandbox/wei-li-cai-dang-yue-fen-de-kai-jiang-ji-lu-forked-rt67ty)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto649()\nprint(result)\n```\n\n[\u4eca\u5f69539](https://codesandbox.io/p/sandbox/da-le-tou-dang-yue-fen-de-kai-jiang-ji-lu-forked-n5t886)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.daily_cash()\nprint(result)\n```\n\n[\u96d9\u8d0f\u5f69](https://codesandbox.io/p/sandbox/da-le-tou-dang-yue-fen-de-kai-jiang-ji-lu-forked-vmlhst)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto1224()\nprint(result)\n```\n\n[3\u661f\u5f69](https://codesandbox.io/p/sandbox/3xing-cai-dang-yue-fen-de-kai-jiang-ji-lu-vsxs3p)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto3d()\nprint(result)\n```\n\n[4\u661f\u5f69](https://codesandbox.io/p/sandbox/4xing-cai-dang-yue-fen-de-kai-jiang-ji-lu-3pwkfk)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto4d()\nprint(result)\n```\n\n[38\u6a02\u5408\u5f69](https://codesandbox.io/p/sandbox/38le-he-cai-dang-yue-fen-de-kai-jiang-ji-lu-yfphxf)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto38m6()\nprint(result)\n```\n\n[39\u6a02\u5408\u5f69](https://codesandbox.io/p/sandbox/39le-he-cai-dang-yue-fen-de-kai-jiang-ji-lu-mgqwfg)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto39m5()\nprint(result)\n```\n\n[49\u6a02\u5408\u5f69](https://codesandbox.io/p/sandbox/49le-he-cai-dang-yue-fen-de-kai-jiang-ji-lu-jgy94n)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto49m6()\nprint(result)\n```\n\n---\n\n### \u722c\u53d6\u6307\u5b9a\u5e74\u6708\u7684\u958b\u734e\u7d00\u9304(YYYY-MM)\n\n[\u5a01\u529b\u5f69](https://codesandbox.io/p/sandbox/da-le-tou-dang-yue-fen-de-kai-jiang-ji-lu-forked-ksq74y)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.super_lotto(['2023', '06'])\nprint(result)\n```\n\n[\u5927\u6a02\u900f](https://codesandbox.io/p/sandbox/wei-li-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-forked-lqcfht)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto649(['2023', '06'])\nprint(result)\n```\n\n[\u4eca\u5f69539](https://codesandbox.io/p/sandbox/wei-li-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-forked-ntvjp7)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.daily_cash(['2023', '06'])\nprint(result)\n```\n\n[\u96d9\u8d0f\u5f69](https://codesandbox.io/p/sandbox/wei-li-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-forked-22dtrx)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto1224(['2023', '06'])\nprint(result)\n```\n\n[3\u661f\u5f69](https://codesandbox.io/p/sandbox/3xing-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-vsfvlx)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto3d(['2023', '08'])\nprint(result)\n```\n\n[4\u661f\u5f69](https://codesandbox.io/p/sandbox/4xing-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-r8fpxq)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto4d(['2023', '08'])\nprint(result)\n```\n\n[38\u6a02\u5408\u5f69](https://codesandbox.io/p/sandbox/38le-he-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-m4s9jn)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto38m6(['2023', '08'])\nprint(result)\n```\n\n[39\u6a02\u5408\u5f69](https://codesandbox.io/p/sandbox/39le-he-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-lskqmm)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto39m5(['2023', '08'])\nprint(result)\n```\n\n[49\u6a02\u5408\u5f69](https://codesandbox.io/p/sandbox/49le-he-cai-zhi-ding-nian-yue-de-kai-jiang-ji-lu-ff6d5d)\n\n```python\nfrom TaiwanLottery import TaiwanLotteryCrawler\n\nlottery = TaiwanLotteryCrawler()\nresult = lottery.lotto49m6(['2023', '08'])\nprint(result)\n```\n\n## \u8cc7\u6599\u4f86\u6e90\n\n- [https://www.taiwanlottery.com/lotto/history/history_result/](https://www.taiwanlottery.com/lotto/history/history_result/)\n\n## License\n\nMIT License\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Taiwan Lottery Crawler \u53f0\u7063\u5f69\u5238\u722c\u87f2",
    "version": "1.5.1",
    "project_urls": {
        "Source": "https://github.com/stu01509/TaiwanLotteryCrawler"
    },
    "split_keywords": [
        "python",
        "taiwanlottery",
        "crawler",
        "lottery",
        "taiwan",
        "\u53f0\u7063\u5f69\u5238",
        "\u6a02\u900f",
        "\u5f69\u5238"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "53ee2c89df5b59b40b2f2dc15242590d7990105c593bd1b45197425a0de664cd",
                "md5": "302acf1f1af0c3d8f1f837cdab97decb",
                "sha256": "209ee99332543c3c9d12b122c95e533b3b88aec729157d56bf315961940f1701"
            },
            "downloads": -1,
            "filename": "taiwanlottery-1.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "302acf1f1af0c3d8f1f837cdab97decb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 9438,
            "upload_time": "2024-01-04T14:26:48",
            "upload_time_iso_8601": "2024-01-04T14:26:48.416962Z",
            "url": "https://files.pythonhosted.org/packages/53/ee/2c89df5b59b40b2f2dc15242590d7990105c593bd1b45197425a0de664cd/taiwanlottery-1.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c8b8ad94793a14b599d4e7ac605503390841090b35ea48bbcdcd9071ce2f04cc",
                "md5": "114f0d057dbdf24ee11d6ede896c7a33",
                "sha256": "7ddfa27092db597cdb75420d79946d1ecb0ddbab300c0bebea0f81f6a1c19e47"
            },
            "downloads": -1,
            "filename": "taiwanlottery-1.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "114f0d057dbdf24ee11d6ede896c7a33",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 10135,
            "upload_time": "2024-01-04T14:26:50",
            "upload_time_iso_8601": "2024-01-04T14:26:50.200803Z",
            "url": "https://files.pythonhosted.org/packages/c8/b8/ad94793a14b599d4e7ac605503390841090b35ea48bbcdcd9071ce2f04cc/taiwanlottery-1.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-04 14:26:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "stu01509",
    "github_project": "TaiwanLotteryCrawler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "taiwanlottery"
}
        
Elapsed time: 3.82991s