[Python] Do I need a local install of Firefox if using Firefox driver in Selenium?

Discussão em 'Python' iniciado por Stack, Abril 17, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using Librewolf as my personal browser, in my script I'm using Firefox driver, do I need to install Firefox in my machine in order for the driver to work "better"? I have a Python + Selenium app to get URL data from a website, it has 35 pages, the script worked for the first 2 pages, on the third gave me en error (class attribute missing). Do I need to give it more wait time? The attribute I'm trying to get is FS03250425_BCN03A20 from

    <div class="costa-itinerary-tile FS03250425_BCN03A20" data-cc-cruise-id="FS03250425_BCN03A20">


    Is there a better way to do it? And this is the code I'm using

    select_url_css = "data-cc-cruise-id"
    select_tile_css = "div.costa-itinerary-tile"
    element = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.CSS_SELECTOR, select_tile_css)))
    elements = driver.find_elements(By.CSS_SELECTOR, select_tile_css)
    for element in elements:
    url_raw = element.get_attribute(select_url_css)

    Continue reading...

Compartilhe esta Página