Skip to content

Commit

Permalink
ČD final?
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkasparek committed Nov 2, 2024
1 parent 5d17b8a commit ee01830
Show file tree
Hide file tree
Showing 6 changed files with 2,945 additions and 2,523 deletions.
10 changes: 6 additions & 4 deletions 001_cd_scrapovani.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def cd(odkud, kam, pocet_dni=0):

sleep(1)

with open(os.path.join(f"downloads/{datetime.now().strftime('%Y-%m-%d')}",f"cd_{odkud}_{kam}_D{pocet_dni:02}_{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.txt"), "w+", encoding="utf-8") as ven:
with open(os.path.join(f"downloads/{datetime.now().strftime('%Y-%m-%d')}",f"cd_{odkud}_{kam}_D{pocet_dni:02}_{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.html"), "w+", encoding="utf-8") as ven:
ven.write(driver.page_source)

print("Výstup uložen.")
Expand All @@ -93,12 +93,12 @@ def cd(odkud, kam, pocet_dni=0):
print(f"Projáníčka, propáníčka, pro ztracené korále – máme všichni namále: {e}.")

trasy = [
('Praha','Brno'),
('Brno','Praha'),
('Praha hl.n','Brno hl.n.'),
('Brno hl.n.','Praha hl.n'),
('Karlovy Vary','Ostrava'),
('Slavonice','Plzeň'),
('Ústí nad Labem','Vídeň'),
('Brno', 'Hamburg'),
('Brno hl.n.', 'Hamburg'),
('Olomouc','Przemysl'),
('Pardubice','Poprad')
]
Expand All @@ -107,6 +107,8 @@ def cd(odkud, kam, pocet_dni=0):
dny.append(random.randint(8, 14))
dny.append(random.randint(15, 60))

sleep(random.randint(0, 4500))

for d in dny:
for x in trasy:
cd(x[0],x[1], pocet_dni=d)
Loading

0 comments on commit ee01830

Please sign in to comment.