I'm trying to create this bot that will refresh the page until an element is visible. My problem is that the bot isn't refreshing and I can't seem to figure out why:)
EDIT: The bot refreshes the desired page now until the desired elememt is visible, however the bot wont click the desired element it was looking for, and that I cant seem to figure out why, since the code says "element.click()"
I believe that this is the logs
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
driver = webdriver.Chrome(executable_path="C:\webdrivers\chromedriver.exe")
driver.get("xxx")
driver.maximize_window()
click = driver.find_element_by_xpath('//*[@id="coiPage-1"]/div[2]/div[1]/button[1]')
click.click()
time.sleep(1)
while true:
if(driver.find_elements_by_xpath('//*[@id="siteContainer"]/div[6]/div/div[3]/div[1]/div[2]/div/div/div[2]/div[2]/div[3]/div[2]/form/button'))
element.click()
break
else:
driver.refresh()
continue