Untitled
unknown
plain_text
a year ago
1.1 kB
15
Indexable
// Step 1: Select the desired date from the dropdown
var dateDropdown = document.getElementById('reservation_date');
if (dateDropdown) {
dateDropdown.value = "2024-08-17"; // Set your desired date in YYYY-MM-DD format
var event = new Event('change', { bubbles: true });
dateDropdown.dispatchEvent(event);
console.log("Date set to 2024-08-17.");
}
// Step 2: Select the desired time slot (e.g., 1:00pm)
var timeSlotContainer = document.querySelector('div.slot_container[data-time=" 1:00pm"]');
if (timeSlotContainer) {
var timeSlot = timeSlotContainer.querySelector('.slot');
if (timeSlot) {
timeSlot.click(); // Simulate the click on the time slot
console.log("Time slot 1:00pm clicked.");
// Step 3: Confirm the reservation if necessary
var confirmButton = timeSlotContainer.querySelector('.confirm');
if (confirmButton && confirmButton.textContent.includes("Click again to reserve")) {
confirmButton.click(); // Simulate the confirmation click
console.log("Confirmation clicked.");
}
}
}
Editor is loading...
Leave a Comment