Commit 3c36e498 authored by BooDonky's avatar BooDonky
Browse files

fixed confirm button

parent 57b4e89d
......@@ -10,11 +10,11 @@ import pickle
def cookies_saver(driver):
driver.find_element_by_xpath("/html/body/aside[1]/a").click()
driver.find_element_by_xpath("//*[@id='block-locale-language']/div/ul/li[1]/a").click()
driver.find_element_by_xpath("//*[@id='edit-name']").send_keys(email)
driver.find_element_by_xpath("//*[@id='edit-pass']").send_keys(pw)
driver.find_element_by_xpath("//*[@id='edit-submit']").click()
# driver.find_element_by_xpath("/html/body/aside[1]/a").click()
# driver.find_element_by_xpath("//*[@id='block-locale-language']/div/ul/li[1]/a").click()
# driver.find_element_by_xpath("//*[@id='edit-name']").send_keys(email)
# driver.find_element_by_xpath("//*[@id='edit-pass']").send_keys(pw)
# driver.find_element_by_xpath("//*[@id='edit-submit']").click()
# storing the cookies
pickle.dump(driver.get_cookies(), open("cookies.pkl", "wb"))
......@@ -36,35 +36,56 @@ def login(driver):
driver.find_element_by_xpath("//*[@id='block-locale-language']/div/ul/li[1]/a").click()
driver.find_element_by_xpath("//*[@id='edit-name']").send_keys(email)
driver.find_element_by_xpath("//*[@id='edit-pass']").send_keys(pw)
time.sleep(2)
driver.find_element_by_xpath("//a[text()='Ok, tout accepter']").click()
driver.find_element_by_xpath("//*[@id='edit-submit']").click()
# Nur für Cookies
#time.sleep(2)
#cookies_saver(driver)
def searcher(driver,url_bookingsite):
driver.maximize_window()
# driver.get("https://www.bataclan.fr/en/event/cult-of-ya-fest_2022-01-15/")
driver.get(url_bookingsite)
#cookies_loader(driver)
# driver.execute_script("document.body.style.zoom='50%'")
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(1)
def booker(driver):
def booker(driver,nt):
driver.find_element_by_xpath("//span[text()='Book now']").click()
driver.find_element_by_xpath("//*[@id='generic-catalog-meeting-form']/div/div[1]/div[1]/ul/li/ul/li[1]").click()
time.sleep(2)
#driver.find_element_by_xpath("//button[@class='ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close']").click()
driver.find_element_by_xpath("//li[starts-with(@data-name,'category 1')]|//li[starts-with(@data-name,'categorie 1')]" ).click()
# driver.execute_script("document.body.style.zoom='80%'")
time.sleep(1)
select = Select(driver.find_element_by_tag_name("select"))
# select by visible text
select.select_by_visible_text('3')
time.sleep(2)
driver.find_element_by_name("op").click()
select.select_by_index(5)
time.sleep(3)
#driver.find_element_by_name('op').click()
driver.find_element_by_xpath("//*[starts-with(@id,'edit-submit-')]").click()
def card_information(driver,cardnumber,cvv,expire_date, holder_name):
driver.find_element_by_xpath
time.sleep(2)
driver.find_element_by_id("new-checkout-button").click()
url = "https://www.bataclan.fr/"
url_bookingsite = "https://billetterie.bataclan.fr/meeting/3601/david-carreira/bataclan/11-02-2022/20h00"
#url_bookingsite = "https://www.bataclan.fr/en/event/the-jesus-mary-chain_2021-12-05/"
#url_bookingsite = "https://www.bataclan.fr/en/event/david-carreira-_2022-02-11/"
url_bookingsite = "https://www.bataclan.fr/en/event/the-jesus-mary-chain_2021-12-05/"
csv = "files/bataclan_cookies.csv"
number_of_tickets = '5'
email = "dominik.nguyen98@gmx.ch"
pw = "GoogleCool11"
......@@ -77,6 +98,8 @@ login(driver)
searcher(driver, url_bookingsite)
booker(driver)
booker(driver,number_of_tickets)
#card_information(driver,None,None,None,None)
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