Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

AMBIENTE B - ABERTURA (autosaved) Logout

File Edit View Insert Cell Kernel Widgets Help Not Trusted Python 3 (ipykernel) 

        Run    Code 

In [134]: from selenium import webdriver


from selenium.webdriver.common.keys import Keys

import pyautogui

#AMBIENTE T8-B

COD = input("Cód Processamento:")


DIA = input("Dia Atual:")
MES = input("Mes Atual:")
PF = "110101"
PJ = "110201"
FILTRO = "SITUACAOCONTRATO NOT IN ('P','B') AND (@STATUS NOT IN ('A_CTRA','C_N_DADO','CLI_RET','CONFPGTO','DESC_DIV','RESOLVA','A
FILTRO2 = "ORDER BY CORINGA2 ASC, DIASEMATRASO DESC, VALORMONTANTE DESC"
LISTA1 = '//*[@id="divTableCont1"]/table/tbody/tr[2]/td[3]/a'
LISTA2 = '//*[@id="divTableCont1"]/table/tbody/tr[4]/td[3]/a'
LISTA3 = '//*[@id="divTableCont1"]/table/tbody/tr[6]/td[3]/a'
LISTA4 = '//*[@id="divTableCont1"]/table/tbody/tr[8]/td[3]/a'
LISTA5 = '//*[@id="divTableCont1"]/table/tbody/tr[10]/td[3]/a'
LISTA6 = '//*[@id="divTableCont1"]/table/tbody/tr[12]/td[3]/a'
LISTA7 = '//*[@id="divTableCont1"]/table/tbody/tr[14]/td[3]/a'
LISTA8 = '//*[@id="divTableCont1"]/table/tbody/tr[16]/td[3]/a'

#BINA03

#L1
navegador = webdriver.Chrome()
navegador.get('http://asp-t8-alm-02.gruponp.local/lmsrv/controller.php?cid=logon&do=input')
navegador.find_element('xpath', '//*[@id="brandingContainer"]/div/div[2]/div[2]/input'). send_keys("jlnita")
navegador.find_element('xpath', '//*[@id="brandingContainer"]/div/div[4]/div[2]/input'). send_keys("control")
navegador.find_element('xpath', '//*[@id="div_buttonbar"]/input[1]'). send_keys(Keys.ENTER)
navegador.find_element('xpath', '//*[@id="strategy"]'). send_keys(Keys.ENTER)
navegador.find_element('xpath', '//*[@id="strategy_fl"]'). send_keys(Keys.ENTER)
navegador.find_element('xpath', '//*[@id="basicSearch"]/input'). click()
pyautogui.write("BINA03")
pyautogui.hotkey("enter")
navegador.find_element('xpath', '//*[@id="divTableCont1"]/table/thead/tr/th[4]/a[1]'). click()
navegador.find_element('xpath', LISTA1). send_keys(Keys.ENTER)
navegador.find_element('xpath', '//*[@id="divAdvanced"]/textarea'). send_keys(Keys.ENTER)
pyautogui.hotkey("ctrl","a")
pyautogui.press("del")
pyautogui.write(FILTRO)
pyautogui.hotkey("enter")
pyautogui.hotkey("enter")
pyautogui.write(f"AND CODPROCESSAMENTO = '{COD}'")
pyautogui.hotkey("enter")
pyautogui.write("AND SEGMENTO IN ('C16','C17','K60','K17','K16')")

You might also like