add Pin page handling
This commit is contained in:
parent
b04c48c26a
commit
b228a91174
32
C-Impf.py
32
C-Impf.py
|
@ -3,8 +3,8 @@ TBD
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = "Lukas Mahler"
|
__author__ = "Lukas Mahler"
|
||||||
__version__ = "0.0.2"
|
__version__ = "0.0.3"
|
||||||
__date__ = "28.05.2021"
|
__date__ = "05.06.2021"
|
||||||
__email__ = "m@hler.eu"
|
__email__ = "m@hler.eu"
|
||||||
__status__ = "Development"
|
__status__ = "Development"
|
||||||
|
|
||||||
|
@ -70,7 +70,6 @@ def main():
|
||||||
init()
|
init()
|
||||||
url = 'https://353-iz.impfterminservice.de/impftermine/service?plz=20357'
|
url = 'https://353-iz.impfterminservice.de/impftermine/service?plz=20357'
|
||||||
# test
|
# test
|
||||||
url = 'https://226-iz.impfterminservice.de/impftermine/service?plz=22417'
|
|
||||||
url = 'https://226-iz.impfterminservice.de/impftermine/service?plz=22457'
|
url = 'https://226-iz.impfterminservice.de/impftermine/service?plz=22457'
|
||||||
|
|
||||||
chrome_driver = find_driver()
|
chrome_driver = find_driver()
|
||||||
|
@ -129,7 +128,7 @@ def main():
|
||||||
element_alter.send_keys(Keys.ENTER)
|
element_alter.send_keys(Keys.ENTER)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
waiting = WebDriverWait(driver, 3).until(ec.url_changes(url))
|
WebDriverWait(driver, 3).until(ec.url_changes(url))
|
||||||
except TimeoutException:
|
except TimeoutException:
|
||||||
print(Fore.RED + "=> Doch keine Termine" + Style.RESET_ALL)
|
print(Fore.RED + "=> Doch keine Termine" + Style.RESET_ALL)
|
||||||
exit()
|
exit()
|
||||||
|
@ -142,7 +141,30 @@ def main():
|
||||||
element_email.send_keys('test@test.de')
|
element_email.send_keys('test@test.de')
|
||||||
|
|
||||||
element_tel = driver.find_element_by_css_selector("input[formControlName=phone]")
|
element_tel = driver.find_element_by_css_selector("input[formControlName=phone]")
|
||||||
element_tel.send_keys('0000000000000000')
|
element_tel.send_keys('000000000000')
|
||||||
|
|
||||||
|
url = driver.current_url
|
||||||
|
element_tel.send_keys(Keys.ENTER)
|
||||||
|
|
||||||
|
try:
|
||||||
|
WebDriverWait(driver, 3).until(ec.url_changes(url))
|
||||||
|
except TimeoutException:
|
||||||
|
print(Fore.RED + "=> Anforderung fehlgeschlagen" + Style.RESET_ALL)
|
||||||
|
exit()
|
||||||
|
|
||||||
|
print(Fore.GREEN + "=> Buchung möglich, bitte Pin übergeben" + Style.RESET_ALL)
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
# Benachrichtigung das eine Buchung durchgeführt werden kann
|
||||||
|
# Irgendwie muss die PIN nun innerhalb von 10 Minuten vom Handy zur Website
|
||||||
|
pin = input("Bitte Pin eingeben: ")
|
||||||
|
|
||||||
|
element_pin = WebDriverWait(driver, 10).until(
|
||||||
|
ec.presence_of_element_located(
|
||||||
|
(By.CSS_SELECTOR, "input[formControlName=pin]")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
element_pin.send_keys(pin)
|
||||||
|
|
||||||
# Wait Hack, delete on production
|
# Wait Hack, delete on production
|
||||||
input()
|
input()
|
||||||
|
|
Loading…
Reference in New Issue