Skip to content

Commit

Permalink
opravené stahování Ostravy, data za 11/26
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkasparek committed Nov 27, 2024
1 parent bf78e3c commit 37614da
Show file tree
Hide file tree
Showing 13 changed files with 248,620 additions and 277,120 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ le_*.parquet
rj_*.parquet
tm3k
sklad
grafy
6 changes: 3 additions & 3 deletions 001_cd_scrapovani.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from selenium.webdriver.support import expected_conditions as EC
from pyvirtualdisplay import Display

kam = f"downloads/{datetime.now().strftime('%Y-%m-%d')}"
os.makedirs(kam, exist_ok=True)
slozka_kam = f"downloads/{datetime.now().strftime('%Y-%m-%d')}"
os.makedirs(slozka_kam, exist_ok=True)

def cd(odkud, kam, pocet_dni=0):

Expand Down Expand Up @@ -90,7 +90,7 @@ def cd(odkud, kam, pocet_dni=0):

with open(
os.path.join(
kam,
slozka_kam,
f"cd_{odkud}_{kam}_D{pocet_dni:02}_{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.html",
),
"w+",
Expand Down
19 changes: 14 additions & 5 deletions 002_cd_cisteni.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 14,
"id": "e27c863b-fd97-4b32-b4b3-0825cb67f49e",
"metadata": {},
"outputs": [],
Expand All @@ -15,7 +15,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 15,
"id": "ad771ad2-9650-42bf-a22b-b9249d883ccd",
"metadata": {},
"outputs": [],
Expand All @@ -30,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 16,
"id": "4d3db07f-3600-48ac-b158-70ea455b365a",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -116,12 +116,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 17,
"id": "e297e728-2198-4215-af23-6cf12ab2802f",
"metadata": {
"scrolled": true
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"cd_2024-11-26.parquet\n",
"2024-11-26: 84\n"
]
}
],
"source": [
"kam = \"data\" \n",
"os.makedirs(kam, exist_ok=True)\n",
Expand Down
1,174 changes: 4 additions & 1,170 deletions 004_rj_cisteni.ipynb

Large diffs are not rendered by default.

69 changes: 4 additions & 65 deletions 006_le_cisteni.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 15,
"id": "b0a1dca1-f4fa-4174-aa26-f2b8cbb5ea79",
"metadata": {},
"outputs": [],
Expand All @@ -15,7 +15,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 16,
"id": "dcfe8419-4463-470c-aed0-b72de890da5e",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -103,76 +103,15 @@
},
{
"cell_type": "code",
"execution_count": 3,
"id": "426dda8f-5d1c-41bc-a09d-d25d29df9e23",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'vlaky': set(),\n",
" 'odkud': 'Praha hl.n.',\n",
" 'odjezd': datetime.datetime(2024, 11, 15, 16, 0),\n",
" 'kam': 'Kraków Główny',\n",
" 'cena': '1279',\n",
" 'oscrapovano': datetime.datetime(2024, 11, 8, 20, 16, 21),\n",
" 'predstih': datetime.timedelta(days=6, seconds=71019),\n",
" 'prodejce': 'LE',\n",
" 'prestupy': -1},\n",
" {'vlaky': {'LE413'},\n",
" 'odkud': 'Praha hl.n.',\n",
" 'odjezd': datetime.datetime(2024, 11, 15, 16, 0),\n",
" 'kam': 'Kraków Główny',\n",
" 'cena': '1279',\n",
" 'jizdni_doba': 361,\n",
" 'vzdalenost': 501,\n",
" 'volna_mista_economy': 19,\n",
" 'volna_mista_economy_plus': 10,\n",
" 'volna_mista_economy_business': 9,\n",
" 'volna_mista_premium': 4,\n",
" 'oscrapovano': datetime.datetime(2024, 11, 8, 20, 16, 21),\n",
" 'predstih': datetime.timedelta(days=6, seconds=71019),\n",
" 'prodejce': 'LE',\n",
" 'prestupy': 0,\n",
" 'volnych_mist': 42}]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"oscrapuj_le(\"downloads/2024-11-08\",\"le_Praha_Krak%C3%B3w%20G%C5%82%C3%B3wny_D04_2024-11-08_20-16-21.html\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 17,
"id": "ace7b62e-9cf2-4268-aac8-29a94271508f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2024-11-07: 128\n",
"2024-11-08: 436\n",
"2024-11-09: 287\n",
"2024-11-10: 259\n",
"2024-11-11: 269\n",
"2024-11-12: 299\n",
"2024-11-13: 276\n",
"2024-11-14: 269\n",
"2024-11-15: 284\n",
"2024-11-16: 258\n",
"2024-11-17: 251\n",
"2024-11-18: 251\n",
"2024-11-19: 267\n",
"2024-11-20: 270\n",
"2024-11-21: 292\n",
"2024-11-22: 263\n",
"2024-11-23: 235\n"
"2024-11-26: 254\n"
]
}
],
Expand Down
Loading

0 comments on commit 37614da

Please sign in to comment.