Data crawling from https://vietlott.vn/, results for products:
These are backtest results for the strategies I have tested (just the abstract method at the moment, you can't predict lotery lol)
predicted: 20 / day (20 tickets perday or 200,000 vnd) predicted corrected:
date | result | predicted | |
---|---|---|---|
12370 | 2021-01-02 | [7, 19, 23, 26, 35, 45, 11] | [26, 45, 53, 19, 35, 11] |
21995 | 2017-11-04 | [2, 8, 12, 44, 46, 52, 9] | [9, 52, 12, 2, 8, 51] |
date | id | result | page | process_time |
---|---|---|---|---|
2025-01-18 | 01141 | [1, 3, 26, 31, 37, 41, 51] | 0 | 2025-01-21 16:53:35.592973 |
2025-01-16 | 01140 | [8, 16, 34, 37, 47, 50, 23] | 0 | 2025-01-21 16:53:35.593229 |
2025-01-14 | 01139 | [3, 11, 12, 24, 33, 40, 46] | 0 | 2025-01-21 16:53:35.593336 |
2025-01-11 | 01138 | [10, 25, 26, 29, 37, 46, 14] | 0 | 2025-01-21 16:53:35.593432 |
2025-01-09 | 01137 | [18, 21, 31, 39, 50, 53, 13] | 0 | 2025-01-21 16:53:35.593527 |
2025-01-07 | 01136 | [4, 5, 9, 16, 22, 39, 30] | 0 | 2025-01-08 10:41:06.663806 |
2025-01-04 | 01135 | [4, 10, 30, 36, 40, 53, 51] | 0 | 2025-01-07 13:09:17.203436 |
2025-01-02 | 01134 | [4, 10, 18, 22, 41, 45, 50] | 0 | 2025-01-07 13:09:17.203531 |
2024-12-31 | 01133 | [8, 13, 29, 36, 42, 43, 28] | 0 | 2025-01-07 13:09:17.203777 |
2024-12-28 | 01132 | [6, 19, 36, 42, 53, 55, 39] | 0 | 2025-01-07 13:09:17.203893 |
result | count | % | - | result | count | % | - | result | count | % |
---|---|---|---|---|---|---|---|---|---|---|
1 | 157 | 1.97 | 21 | 139 | 1.74 | 41 | 167 | 2.09 | ||
2 | 133 | 1.67 | 22 | 165 | 2.07 | 42 | 143 | 1.79 | ||
3 | 157 | 1.97 | 23 | 158 | 1.98 | 43 | 159 | 1.99 | ||
4 | 129 | 1.62 | 24 | 144 | 1.8 | 44 | 150 | 1.88 | ||
5 | 145 | 1.82 | 25 | 135 | 1.69 | 45 | 140 | 1.75 | ||
6 | 126 | 1.58 | 26 | 135 | 1.69 | 46 | 155 | 1.94 | ||
7 | 124 | 1.55 | 27 | 133 | 1.67 | 47 | 144 | 1.8 | ||
8 | 153 | 1.92 | 28 | 128 | 1.6 | 48 | 152 | 1.9 | ||
9 | 160 | 2 | 29 | 151 | 1.89 | 49 | 150 | 1.88 | ||
10 | 138 | 1.73 | 30 | 125 | 1.57 | 50 | 145 | 1.82 | ||
11 | 150 | 1.88 | 31 | 151 | 1.89 | 51 | 166 | 2.08 | ||
12 | 157 | 1.97 | 32 | 153 | 1.92 | 52 | 149 | 1.87 | ||
13 | 138 | 1.73 | 33 | 149 | 1.87 | 53 | 154 | 1.93 | ||
14 | 140 | 1.75 | 34 | 159 | 1.99 | 54 | 140 | 1.75 | ||
15 | 133 | 1.67 | 35 | 149 | 1.87 | 55 | 144 | 1.8 | ||
16 | 136 | 1.7 | 36 | 138 | 1.73 | |||||
17 | 132 | 1.65 | 37 | 130 | 1.63 | |||||
18 | 148 | 1.85 | 38 | 137 | 1.72 | |||||
19 | 142 | 1.78 | 39 | 137 | 1.72 | |||||
20 | 157 | 1.97 | 40 | 157 | 1.97 |
result | count | % | - | result | count | % | - | result | count | % |
---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | 1.19 | 24 | 1 | 1.19 | 45 | 1 | 1.19 | ||
3 | 2 | 2.38 | 25 | 1 | 1.19 | 46 | 2 | 2.38 | ||
4 | 3 | 3.57 | 26 | 2 | 2.38 | 47 | 1 | 1.19 | ||
5 | 1 | 1.19 | 27 | 1 | 1.19 | 48 | 1 | 1.19 | ||
6 | 2 | 2.38 | 28 | 1 | 1.19 | 50 | 3 | 3.57 | ||
8 | 2 | 2.38 | 29 | 2 | 2.38 | 51 | 3 | 3.57 | ||
9 | 1 | 1.19 | 30 | 2 | 2.38 | 53 | 3 | 3.57 | ||
10 | 3 | 3.57 | 31 | 2 | 2.38 | 55 | 1 | 1.19 | ||
11 | 1 | 1.19 | 32 | 1 | 1.19 | |||||
12 | 1 | 1.19 | 33 | 3 | 3.57 | |||||
13 | 2 | 2.38 | 34 | 1 | 1.19 | |||||
14 | 1 | 1.19 | 36 | 3 | 3.57 | |||||
16 | 3 | 3.57 | 37 | 3 | 3.57 | |||||
17 | 1 | 1.19 | 38 | 1 | 1.19 | |||||
18 | 3 | 3.57 | 39 | 3 | 3.57 | |||||
19 | 1 | 1.19 | 40 | 2 | 2.38 | |||||
20 | 1 | 1.19 | 41 | 3 | 3.57 | |||||
21 | 1 | 1.19 | 42 | 2 | 2.38 | |||||
22 | 2 | 2.38 | 43 | 1 | 1.19 | |||||
23 | 1 | 1.19 | 44 | 1 | 1.19 |
result | count | % | - | result | count | % | - | result | count | % |
---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | 1.19 | 24 | 1 | 1.19 | 45 | 1 | 1.19 | ||
3 | 2 | 2.38 | 25 | 1 | 1.19 | 46 | 2 | 2.38 | ||
4 | 3 | 3.57 | 26 | 2 | 2.38 | 47 | 1 | 1.19 | ||
5 | 1 | 1.19 | 27 | 1 | 1.19 | 48 | 1 | 1.19 | ||
6 | 2 | 2.38 | 28 | 1 | 1.19 | 50 | 3 | 3.57 | ||
8 | 2 | 2.38 | 29 | 2 | 2.38 | 51 | 3 | 3.57 | ||
9 | 1 | 1.19 | 30 | 2 | 2.38 | 53 | 3 | 3.57 | ||
10 | 3 | 3.57 | 31 | 2 | 2.38 | 55 | 1 | 1.19 | ||
11 | 1 | 1.19 | 32 | 1 | 1.19 | |||||
12 | 1 | 1.19 | 33 | 3 | 3.57 | |||||
13 | 2 | 2.38 | 34 | 1 | 1.19 | |||||
14 | 1 | 1.19 | 36 | 3 | 3.57 | |||||
16 | 3 | 3.57 | 37 | 3 | 3.57 | |||||
17 | 1 | 1.19 | 38 | 1 | 1.19 | |||||
18 | 3 | 3.57 | 39 | 3 | 3.57 | |||||
19 | 1 | 1.19 | 40 | 2 | 2.38 | |||||
20 | 1 | 1.19 | 41 | 3 | 3.57 | |||||
21 | 1 | 1.19 | 42 | 2 | 2.38 | |||||
22 | 2 | 2.38 | 43 | 1 | 1.19 | |||||
23 | 1 | 1.19 | 44 | 1 | 1.19 |
result | count | % | - | result | count | % | - | result | count | % |
---|---|---|---|---|---|---|---|---|---|---|
1 | 4 | 2.29 | 21 | 3 | 1.71 | 41 | 5 | 2.86 | ||
2 | 1 | 0.57 | 22 | 3 | 1.71 | 42 | 3 | 1.71 | ||
3 | 3 | 1.71 | 23 | 1 | 0.57 | 43 | 2 | 1.14 | ||
4 | 5 | 2.86 | 24 | 5 | 2.86 | 44 | 2 | 1.14 | ||
5 | 1 | 0.57 | 25 | 2 | 1.14 | 45 | 3 | 1.71 | ||
6 | 2 | 1.14 | 26 | 4 | 2.29 | 46 | 2 | 1.14 | ||
7 | 1 | 0.57 | 27 | 2 | 1.14 | 47 | 3 | 1.71 | ||
8 | 3 | 1.71 | 28 | 2 | 1.14 | 48 | 3 | 1.71 | ||
9 | 4 | 2.29 | 29 | 5 | 2.86 | 49 | 1 | 0.57 | ||
10 | 5 | 2.86 | 30 | 4 | 2.29 | 50 | 3 | 1.71 | ||
11 | 5 | 2.86 | 31 | 2 | 1.14 | 51 | 6 | 3.43 | ||
12 | 4 | 2.29 | 32 | 3 | 1.71 | 52 | 1 | 0.57 | ||
13 | 3 | 1.71 | 33 | 4 | 2.29 | 53 | 5 | 2.86 | ||
14 | 2 | 1.14 | 34 | 1 | 0.57 | 54 | 3 | 1.71 | ||
15 | 1 | 0.57 | 35 | 1 | 0.57 | 55 | 2 | 1.14 | ||
16 | 11 | 6.29 | 36 | 5 | 2.86 | |||||
17 | 2 | 1.14 | 37 | 5 | 2.86 | |||||
18 | 4 | 2.29 | 38 | 3 | 1.71 | |||||
19 | 3 | 1.71 | 39 | 6 | 3.43 | |||||
20 | 3 | 1.71 | 40 | 3 | 1.71 |
result | count | % | - | result | count | % | - | result | count | % |
---|---|---|---|---|---|---|---|---|---|---|
1 | 5 | 1.88 | 21 | 4 | 1.5 | 41 | 7 | 2.63 | ||
2 | 2 | 0.75 | 22 | 5 | 1.88 | 42 | 5 | 1.88 | ||
3 | 4 | 1.5 | 23 | 1 | 0.38 | 43 | 3 | 1.13 | ||
4 | 5 | 1.88 | 24 | 6 | 2.26 | 44 | 2 | 0.75 | ||
5 | 4 | 1.5 | 25 | 3 | 1.13 | 45 | 4 | 1.5 | ||
6 | 4 | 1.5 | 26 | 7 | 2.63 | 46 | 4 | 1.5 | ||
7 | 2 | 0.75 | 27 | 3 | 1.13 | 47 | 5 | 1.88 | ||
8 | 3 | 1.13 | 28 | 3 | 1.13 | 48 | 4 | 1.5 | ||
9 | 7 | 2.63 | 29 | 8 | 3.01 | 49 | 3 | 1.13 | ||
10 | 6 | 2.26 | 30 | 5 | 1.88 | 50 | 4 | 1.5 | ||
11 | 6 | 2.26 | 31 | 8 | 3.01 | 51 | 11 | 4.14 | ||
12 | 5 | 1.88 | 32 | 3 | 1.13 | 52 | 2 | 0.75 | ||
13 | 3 | 1.13 | 33 | 6 | 2.26 | 53 | 6 | 2.26 | ||
14 | 4 | 1.5 | 34 | 4 | 1.5 | 54 | 6 | 2.26 | ||
15 | 2 | 0.75 | 35 | 2 | 0.75 | 55 | 3 | 1.13 | ||
16 | 13 | 4.89 | 36 | 6 | 2.26 | |||||
17 | 5 | 1.88 | 37 | 7 | 2.63 | |||||
18 | 4 | 1.5 | 38 | 3 | 1.13 | |||||
19 | 6 | 2.26 | 39 | 10 | 3.76 | |||||
20 | 6 | 2.26 | 40 | 7 | 2.63 |
Since there are many people asked, I write this section.
The project is schedule automatically via Github Actions, run a script, fetch data and auto commit to Github. No server is required, I don't need to do anything. Details in workflow file
I just inspected network packages sent between browser and server to find out how data is fetched and replicated that in Python code.
pip install -i https://test.pypi.org/simple/ vietlott-data==0.1.3
project provides two cli
Usage: vietlott-crawl [OPTIONS] PRODUCT
crawl a product with a given run date or from/to index page
Options:
--run-date TEXT
--index_from INTEGER page index from run since we crawl by pagination the
pages
--index_to INTEGER page index from run since we crawl by pagination the
pages
--help Show this message and exit.
Usage: vietlott-missing [OPTIONS] PRODUCT
detect_missing_data and run if needed :param ctx: context :param product:
product to run :param limit: number of pages to run :return:
Options:
--limit INTEGER
--help Show this message and exit.