-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblablamat.py
32 lines (27 loc) · 874 Bytes
/
blablamat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import random
import time
from selenium import webdriver
d = webdriver.Firefox()
create = lambda : d.find_element_by_xpath('//button[text()="Vytvořit upozornění na jízdu"]')
next = lambda : d.find_element_by_xpath('//button[text()="Podívej se na následující den"]')
email = lambda : d.find_element_by_xpath("//input[@name='email']")
submit = lambda : d.find_element_by_xpath("//button[@type='submit']")
random_email = lambda : f"tomas+{random.randint(10000,99999)}@krnak.cz"
random_email = lambda : f"tomas+blablacar.cz+{random.randint(10000,99999)}@krnak.cz"
fill_email = lambda : email().send_keys(random_email())
def subscribe():
create().click()
fill_email()
submit().click()
def step():
subscribe()
while True:
time.sleep(0.25)
try:
next().click()
break
except:
pass
def steps(n):
for _ in range(n):
step()