How can I click over time slots from 9:00 am to 3:00 pm from Monday to Wednesday using selenium python?

Question:

Answers:

You must post your code, this is not a project request website.

However, this can help you:

start_time = "09:00"
end_time = "15:00"

# get the list of day elements
days = driver.find_elements_by_class_name("fc-day-header")

# iterate over the days
for day in days:
    
    # only click on the days from Monday to Wednesday
    if day.text in ["Mon", "Tue", "Wed"]:

        day.click()
        
        # iterate over the time slots
        timeslots = driver.find_elements_by_class_name("fc-axis")
        for timeslot in timeslots:
            if timeslot.text >= start_time and timeslot.text <= end_time:
                # click on the timeslot
                timeslot.click()

Where driver is your WebDriver instance.

Answered By: Juan Melnechuk
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.