This commit is contained in:
Edward Betts 2023-08-11 08:54:09 +01:00
parent 9cd6e6b9e3
commit 67dbfed7b4

View file

@ -1,7 +1,7 @@
#!/usr/bin/python3 #!/usr/bin/python3
import os import os
from datetime import datetime, date from datetime import date, datetime
from playwright.sync_api import Playwright, Request, expect, sync_playwright from playwright.sync_api import Playwright, Request, expect, sync_playwright
@ -50,7 +50,7 @@ class HandleResponse:
def run(playwright: Playwright) -> None: def run(playwright: Playwright) -> None:
"""Launch browser and search for options.""" """Launch browser and search for options."""
browser = playwright.chromium.launch(headless=True) browser = playwright.chromium.launch(headless=False)
context = browser.new_context() context = browser.new_context()
page = context.new_page() page = context.new_page()
@ -60,18 +60,6 @@ def run(playwright: Playwright) -> None:
page.goto("https://www.eurotunnel.com/uk/") page.goto("https://www.eurotunnel.com/uk/")
page.get_by_role("button", name="Accept All Cookies").click() page.get_by_role("button", name="Accept All Cookies").click()
page.get_by_role("textbox", name="Outbound").click() page.get_by_role("textbox", name="Outbound").click()
month = page.locator("div.ui-datepicker-month").first
print(month)
print(month.text_content())
page.close()
context.close()
browser.close()
return
page.get_by_role("row", name="August 2023").get_by_role("cell").nth(1).click() page.get_by_role("row", name="August 2023").get_by_role("cell").nth(1).click()
page.get_by_role("cell", name="29").click() page.get_by_role("cell", name="29").click()
page.get_by_role("textbox", name="Return").click() page.get_by_role("textbox", name="Return").click()