How can I use an xpath path already mapped and saved in csv to confirm access on site?

Asked

Viewed 79 times

1

good afternoon!

I am somewhat new in the area of programming and I am trying to develop a script, so that it enters a certain site, within a file . csv, choose an educational institution, confirm entry, enter the reporting part and download.

When I describe in the script the xpath path to access a selected IES, it works beautifully, my problem is that I can’t make it work from a list. csv with paths already mapped.

    df_SelecionaIES = pd.read_csv(r'C:\Users\lucas.mazetti\Desktop\Lucas\python\1) Robo Acessar e Download\Login e senha\IES.csv', sep=';',encoding='Latin1', dtype={'cod':str})
   

    def pesquisar(self):  
        driver = self.driver
        selecionar = pyautogui.hotkey ('ctrl', 'f')
        time.sleep(1)
        selecionando_ies = pyautogui.typewrite('781')   
        caixa_selecao = driver.find_element_by_xpath('//*[@id="tabelaIes:8:j_id258"]/input').click()
        time.sleep(1)
        pyautogui.hotkey ('enter')

I have a list in . csv with 157 institutions, for each IES that will be located, the xpath path changes, following a growing logical sequence.

My question is, how can I do so that this xpath path can be searched in a saved file

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.