Selenium with Python, trying to click a "pseudo element"

Viewed 32

I'm trying to do web scraping of a page, everything went normal until I figured out, there is a "pseudo element" (::before), let me show you

enter image description here

btw, the inspector is above the "Magnifier Glass"

So the problem comes with detalle_causa = driver.find_element(By.CSS_SELECTOR,'i.fa.fa-search.fa-lg').click()

if t_rol == rol_yr:
        rol_c0.append(t_rol)
        materias_e_c0.append(t_tiporecurso)
        carat_c0.append(t_caratulado)
        fecha_c0.append(t_fecha)
        estado_c0.append(t_estado)
        data = {"ROL": rol_c0,"TIPO RECURSO":materias_e_c0, "CARATULADO":carat_c0, "FECHA":fecha_c0, "ESTADO":estado_c0}
        sleep(3)
        df = pd.DataFrame(data)
        print(df)
        sleep(3)
        detalle_causa = driver.find_element(By.CSS_SELECTOR,'i.fa.fa-search.fa-lg').click()
        print(detalle_causa)
        df.to_csv('2022_cs_p2.csv', index=False, encoding='utf-8')
        sleep(2)

 else:
     print("No era")

EDIT: I need to get access to this.

enter image description here

So if you guys could give me a hand here, I will really appreciate it.

1 Answers
detalle_causa = driver.find_element(By.CSS_SELECTOR,'i.fa.fa-search.fa-lg')
detalle_causa.click()
print(detalle_causa)

You are trying to store a click.

Related