Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Selenium not detecting an element and I cant switch to the iframe

$
0
0

I am trying to scrap links from a website but I can't seem to be able to locate the element related to the products.

The website = https://www.cvlinens.com/collections/table-linens?page=3

My code:

from selenium import webdriverfrom selenium.webdriver.chrome.service import Servicefrom selenium.webdriver.common.by import Byfrom webdriver_manager.chrome import ChromeDriverManagerfrom selenium.webdriver.common.keys import Keysfrom selenium.webdriver.common.action_chains import ActionChainsfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECimport timeimport pandas as pddriver = webdriver.Chrome()url = 'https://www.cvlinens.com/collections/table-linens?page=3'driver.get(url)try:    load = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'products-grid')))except:    driver.close()    print('failed')

It keeps returning 'failed'. I have tried finding the element by xpath and css selector aswell, but no luck.

I read somewhere about iframes and how I would need to switch to the iframe containing the element to access it. But I can't switch to the iframe. It returns 'failed' aswell.


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>