-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
29 lines (22 loc) · 934 Bytes
/
main.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
import time
import datetime
import locale
from selenium import webdriver
from selenium.webdriver.edge.service import Service
# Variables
locale.setlocale(locale.LC_ALL,'es_ES.UTF-8')
print( datetime.date(2024,4,25).strftime("%A") )
# Selenium Configuration
service=Service(executable_path='driver\\chromedriver.exe')
options=webdriver.ChromeOptions()
driver=webdriver.Chrome(service=service, options=options)
driver.maximize_window()
driver.get("https://www.latamairlines.com/")
# Origen
driver.find_element("xpath","//input[contains(@id,'txtInputOrigin_field')]").send_keys('Piura, PIU - Perú')
driver.find_element("xpath", "//button[contains(@id, 'btnItemAutoComplete_0')]").click()
# Destino
driver.find_element("xpath","//input[contains(@id,'txtInputDestination_field')]").send_keys('Lima, LIM - Perú')
driver.find_element("xpath", "//button[contains(@id, 'btnItemAutoComplete_0')]").click()
time.sleep(10)
driver.close()