Python Forum
Keep trying link until enabled
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keep trying link until enabled
#1
Hello,

I have a program to book a court at the gym, it looks like this

import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

options = Options()
# to remove the usb errors
options.add_experimental_option('excludeSwitches', ['enable-logging'])

# to save session data
options.add_argument(
    r'--user-data-dir=C:\Users\pepe\AppData\Local\Google\Chrome\User Data2')
driver = webdriver.Chrome(options=options)

driver.get("https://mydomain.com/someurl")

driver.find_element(By.LINK_TEXT, "19:30").click()
...
And it works, but the thing is the link is enabled at 7am and there is a lot of people trying to book the court at that time.

Is there a way to be able to run the program as soon as the link is enabled?

What can be done in this situation?

Thanks
Reply
#2
Anyone?
Reply
#3
what is the URL?
Reply
#4
It is a private URL only for members.
Reply
#5
Here is the page

[Image: TQQJRVt.png]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  os.system("netsh interface set interface 'Wi-Fi' enabled") aniyanetworks 12 10,221 Jan-18-2019, 04:07 AM
Last Post: aniyanetworks
  lambda-Amazon EC2:Remove instance termination protection if enabled and terminate ins dragan979 0 3,369 Jun-13-2018, 09:48 AM
Last Post: dragan979

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020