I know there's someone else having the same problem as me, but it turns out he's using a different code as me. (I'm NOT having the same problem with this : Selenium identifies the button as clickable when it wasn't) So, apparently I've tried to make the page refreshes everytime the button is unclickable or disabled using the WebDriverException error.
So, everytime the Selenium drops an error of WebDriverException which an error that occurs if you attempt to click a disabled object (If I'm not wrong), it'll refresh the page until it's enabled. It has worked for a few days back, but for some reason I don't know what I've done, It suddenly starts malfunctioning?.
It acts like nothing happened, and drops no error even though the element is clearly disabled. I tried printing the variable just to check if the element actually stored in the variable. But, it did. So I don't know what could be causing the problem. I've put the code below, every helpful answer I appreciate them!. Thank you!.
purchasenow = browser.find_element_by_xpath("/html/body/div[1]/div/div[2]/div[2]/div[2]/div[2]/div[3]/div/div[5]/div/div/button[2]")
purchasenow.click()
print(purchasenow)
while True:
try:
purchasenow.click()
newtime()
print("[INFO :] ORDER BUTTON ENABLED!, ATTEMPTING TO PUT ITEM IN CART...")
webhook = DiscordWebhook(url=logs, content='[INFO :] ORDER BUTTON ENABLED!, ATTEMPTING TO PUT ITEM IN CART...')
if withlogging == "y":
response = webhook.execute()
break
except WebDriverException:
newtime()
print("[INFO :] ORDER BUTTON DISABLED!, REFRESHING THE PAGE...")
webhook = DiscordWebhook(url=logs, content='[INFO :] ORDER BUTTON DISABLED!, REFRESHING THE PAGE...')
if withlogging == "y":
response = webhook.execute()
browser.refresh()
continue
EDIT [12/10/2020] : Tried making it sure with the is_enabled(), somehow it was detected as True or clickable. Still looking for possible solutions, please let me know in the Answers!.