'Hidden buttons Selenium Python

Disclaimer: I am fairly new to python.

I have been trying to create a bot using selenium to reserve a spot at my university gym. However, the time slots only appear briefly. When someone reserves that time, the button disappears from the website. Does anyone know how I can find the xpath to the time slot even though it disappears from the website and program it into the script?

On another note, when a time slot is clicked, a continue button appears. I use two find_element_by_xpath lines after each other but it does not work when I run it.

Thanks for your help.

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source