[Python] Python Selenium Web Scraping by Class Name

Discussão em 'Python' iniciado por Stack, Setembro 25, 2024.

  1. Stack

    Stack Membro Participativo

    The code cannot scrape the web to get the links. The website is: https://www.carrefour.com.ar/Almacen

    and there is always an error related with no such element. I tried with wait and points instead of spaces without luck.

    # Navigate to the page
    driver.get('https://www.carrefour.com.ar/almacen')

    #wait = WebDriverWait(driver, 15)

    div_element = driver.find_element(By.CLASS_NAME, "recs_18369321")

    a_tags = div_element.find_elements(By.TAG_NAME, 'a')

    links = [a.get_attribute('href') for a in a_tags]

    Continue reading...

Compartilhe esta Página