-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdict_test.py
28 lines (21 loc) · 1.14 KB
/
dict_test.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
from find import select_hall
from selenium import webdriver
import time
import json
STETSON_WEST_STATIONS = ["Salsas & Dips", "Soup & Co", "Homestyle", "500 Degrees", "Bok Choy Express",
"Bok Choy Express Fast lane"]
#Salsa is not working because in the x path we are looking for 'Salsa's & Dip' and since it uses one apostrophe the string get cut off
STETSON_EAST_STATIONS = ["Trattoria", "Pizza", "Soup", "Menutainment", "Char Broil"]
driver_directory = '/Library/Frameworks/Python.framework/Versions/3.9/bin/chromedriver'
driver = webdriver.Chrome(driver_directory)
# select-stations : [List-of Stations] -> [List-of Items]
def select_hall_v2(all_stations, hall, meal):
# Search website, allow HTML to load asdf
select_hall(driver, hall, meal)
for station in all_stations:
station_menu = driver.find_elements_by_xpath(f"//caption[contains(text(), '{station}')]/../tbody/tr/td/div/span/strong")
print(f"{station}")
for value in station_menu:
print(f"---- {value.text} -----")
time.sleep(10)
select_hall_v2(STETSON_EAST_STATIONS, "building_612d4606e8297100cdc427ee", "Dinner")