Commit 72534efd authored by BooDonky's avatar BooDonky
Browse files

Hostien Buyer finished

parent fcda5d36
{
}
\ No newline at end of file
<Grid>
<Label>:
font_size: 40
<TextInput>:
font_size: 40
<Button>:
font_size: 40
<Grid>:
small : small
big : big
any : any
GridLayout:
cols: 1
size: root.width, root.height
......@@ -17,25 +31,30 @@
text: "Kleine Hostien: "
TextInput:
id: small
write_tab: False
multiline: False
Label:
text: "Grosse Hostien: "
TextInput:
id: big
write_tab: False
multiline: False
Label:
text: "Sonstiges"
TextInput:
multiline: False
id: any
write_tab: False
multiline: True
GridLayout:
cols: 2
Button:
text: "Abbrechen"
cols: 1
Button:
text: "OK"
on_press: root.ok_btn()
\ No newline at end of file
import kivy
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
from modules.webscript import start_werbdriver
class Grid(Widget):
pass
small = ObjectProperty(None)
big = ObjectProperty(None)
any = ObjectProperty(None)
def ok_btn(self):
print("Kleine Hostien: ", self.small.text,
"\nGrosse Hostien: ", self.big.text,
"\nSonstiges", self.any.text )
start_werbdriver(self.small.text, self.big.text, self.any.text)
class Main(App):
......
kirchengemeinde = "Röm.-Kath. Pfarramt St. Gallus und Othmar"
namen = "Nguyen, Dominik"
ort = "4303 Kaiseraugst"
telefon = "078 962 76 25"
email = "d.nguyen@kath.ch"
rechnungadd = kirchengemeinde + "\nHeidemurweg 30" + "\n4303 Kaiseraugst"
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import time
from modules.config import kirchengemeinde, namen, ort, telefon, email, rechnungadd
def start_werbdriver(small, big, any):
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get("https://www.kloster-gerlisberg.ch/unsere-produkte/hostien/")
driver.find_element_by_xpath("//*[@id='m7f907ad0f91cb1b50']").send_keys(kirchengemeinde)
driver.find_element_by_xpath("//*[@id='m7f907ad0f91cb1b51']").send_keys(namen)
driver.find_element_by_xpath("//*[@id='m7f907ad0f91cb1b52']").send_keys(ort)
driver.find_element_by_xpath("//*[@id='m7f907ad0f91cb1b53']").send_keys(telefon)
driver.find_element_by_xpath("//*[@id='m7f907ad0f91cb1b54']").send_keys(email)
driver.find_element_by_xpath("//*[@id='m7f907ad0f91cb1b56']").click()
driver.find_element_by_xpath("//*[@id='m7f907ad0f91cb1b59']").send_keys(rechnungadd)
if any != None:
driver.find_element_by_xpath("//*[@id='m7f907ad0f91cb1b511']").send_keys("Laien Hostien weiss: {} Stücke\n".format(small) + "Messopfer Hostien weiss: {} Stücke \n".format(big) + any)
else:
driver.find_element_by_xpath("//*[@id='m7f907ad0f91cb1b511']").send_keys("Laien Hostien weiss: {} Stücke\n".format(small) + "Messopfer Hostien weiss: {} Stücke \n".format(big))
time.sleep(2000)
driver = webdriver.Chrome()
driver.get("")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment