I'm trying to automate a repetitive process in building a website in the format of an e-commerce store (I'm an amateur). These are repetitive steps that would certainly save me an extraordinary amount of time. I've already put together some steps, but now I'm stuck trying to find a certain button, I inspect the browser and I can copy the xpath, but when I run the code it doesn't find it. I've read about 200 questions here and I still haven't been able to find an answer that helps me. So if anyone can help me I will be grateful.
Part of the error that appears is this.
TimeoutException Traceback (most recent call last) Cell In[62], line 221 218 WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//span[normalize-space()='Páginas']"))).click() 220 # Clique no botão 'Adicionar Páginas' --> 221 WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="app"]/div[1]/div[2]/div/div[1]/div[2]/div/div[2]/div/div/a/span'))).click()
TimeoutException: Message:
HTML do botão
<a href="https://admin.shopify.com/store/dc7020-3/pages/new" data-polaris-unstyled="true" class="Polaris-Button_r99lw Polaris-Button--pressable_1q8ey Polaris-Button--variantPrimary_1stsb Polaris-Button--sizeMedium_5f35p Polaris-Button--textAlignCenter_1kere"><span class="">Adicionar página</span></a>
Even though I leave the screen already loaded, and run the code just to click, it doesn't find it.
I've already tried: find_element; element_to_be_clickable; presence_of_all_elements_located
I've already tried: By.XPATH; By.ID; By.CSS_SELECTOR; By.NAME; etc
Part of the code I'm trying to run
# Navigate to the "Pages" tab only the first time
if i == 0:
# Click on the 'Pages' tab
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//span[normalize-space()='Páginas']"))).click()
# Click on the 'Add Pages' button
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="app"]/div[1]/div[2]/div/div[1]/div[2]/div/div[2]/div/div/a/span'))).click()