I'm writing a bot to automate a browser game with Selenium. When an error happens, the bot automatically pauses the driver. Even when the button element is clearly visible in the browser, selenium times out after not finding the element.
gold_btn = wait.until(EC.element_to_be_clickable((By.XPATH, '//[@id="perk_target_4"]/div[2]/div[1]/div')))
HTML of the element:
<div class="button_blue pointer" style="height: 11px; width: 120px; padding-top: 2px;">Protein hapları</div>
Even though the operation done is always the same, the loop works for some time, seeing this element. But after like an hour of runtime, it times out after not seeing this element.
I tried adding waits before the button appears, which did not change the outcome.
I was expecting it to just continue as it normally does. It should be able to see the element especially since it is pretty much visible in the browser window and the wait is 30 seconds.