From 9c483352246ff1dd147d6899661c46863c2686e3 Mon Sep 17 00:00:00 2001 From: Joellensilva Date: Sat, 19 Oct 2024 17:39:23 -0300 Subject: [PATCH] atualizando xpaths do coletor --- crawler.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crawler.go b/crawler.go index 057f41a..ac62f29 100644 --- a/crawler.go +++ b/crawler.go @@ -83,10 +83,10 @@ func (c crawler) selecionaContracheque(ctx context.Context) error { chromedp.Navigate("https://mpt.mp.br/MPTransparencia/pages/portal/remuneracaoMembrosAtivos.xhtml"), chromedp.Sleep(c.timeBetweenSteps), // Seleciona o ano - chromedp.SetValue(`//*[@id="j_idt179"]`, c.year, chromedp.BySearch), + chromedp.SetValue(`//*[@id="j_idt177"]`, c.year, chromedp.BySearch), chromedp.Sleep(c.timeBetweenSteps), // Consulta - chromedp.Click(`//*[@id="j_idt182"]`, chromedp.BySearch, chromedp.NodeVisible), + chromedp.Click(`//*[@id="j_idt180"]`, chromedp.BySearch, chromedp.NodeVisible), chromedp.Sleep(c.timeBetweenSteps), ) } @@ -96,10 +96,10 @@ func (c crawler) selecionaVerbas(ctx context.Context) error { chromedp.Click(`//*[@id="sm-contracheque"]`, chromedp.BySearch, chromedp.NodeReady), chromedp.Sleep(c.timeBetweenSteps), // Clica em Verbas Indenizatórias e Outras Remunerações Temporárias - chromedp.Click(`//*[@id="j_idt132"]`, chromedp.BySearch, chromedp.NodeReady), + chromedp.Click(`//*[@id="j_idt130"]`, chromedp.BySearch, chromedp.NodeReady), chromedp.Sleep(c.timeBetweenSteps), // Seleciona o ano - chromedp.SetValue(`//*[@id="j_idt185"]`, c.year, chromedp.BySearch, chromedp.NodeReady), + chromedp.SetValue(`//*[@id="j_idt183"]`, c.year, chromedp.BySearch, chromedp.NodeReady), chromedp.Sleep(c.timeBetweenSteps), // Consulta chromedp.Click(`//*[@id="consultaForm"]/div[2]/div/input`, chromedp.BySearch, chromedp.NodeVisible), @@ -134,7 +134,7 @@ func (c crawler) exportaPlanilha(ctx context.Context, fName string) error { var selectMonth string // O XPath para o botão de download de contracheques e indenizações é diferente. if strings.Contains(fName, "contracheques") { - selectMonth = fmt.Sprintf(`//*[@id="tabelaRemuneracao:%d:j_idt201"]/span`, months[c.month]) + selectMonth = fmt.Sprintf(`//*[@id="tabelaRemuneracao:%d:j_idt199"]/span`, months[c.month]) } else { selectMonth = fmt.Sprintf(`//*[@id="tabelaMeses:%d:linkArq"]`, months[c.month]) }