Skip to content

Commit fb70b73

Browse files
authored
Merge pull request #5 from dadosjusbr/atualizando-coletor
atualizando xpaths do coletor
2 parents 29ff116 + 9c48335 commit fb70b73

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crawler.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ func (c crawler) selecionaContracheque(ctx context.Context) error {
8383
chromedp.Navigate("https://mpt.mp.br/MPTransparencia/pages/portal/remuneracaoMembrosAtivos.xhtml"),
8484
chromedp.Sleep(c.timeBetweenSteps),
8585
// Seleciona o ano
86-
chromedp.SetValue(`//*[@id="j_idt179"]`, c.year, chromedp.BySearch),
86+
chromedp.SetValue(`//*[@id="j_idt177"]`, c.year, chromedp.BySearch),
8787
chromedp.Sleep(c.timeBetweenSteps),
8888
// Consulta
89-
chromedp.Click(`//*[@id="j_idt182"]`, chromedp.BySearch, chromedp.NodeVisible),
89+
chromedp.Click(`//*[@id="j_idt180"]`, chromedp.BySearch, chromedp.NodeVisible),
9090
chromedp.Sleep(c.timeBetweenSteps),
9191
)
9292
}
@@ -96,10 +96,10 @@ func (c crawler) selecionaVerbas(ctx context.Context) error {
9696
chromedp.Click(`//*[@id="sm-contracheque"]`, chromedp.BySearch, chromedp.NodeReady),
9797
chromedp.Sleep(c.timeBetweenSteps),
9898
// Clica em Verbas Indenizatórias e Outras Remunerações Temporárias
99-
chromedp.Click(`//*[@id="j_idt132"]`, chromedp.BySearch, chromedp.NodeReady),
99+
chromedp.Click(`//*[@id="j_idt130"]`, chromedp.BySearch, chromedp.NodeReady),
100100
chromedp.Sleep(c.timeBetweenSteps),
101101
// Seleciona o ano
102-
chromedp.SetValue(`//*[@id="j_idt185"]`, c.year, chromedp.BySearch, chromedp.NodeReady),
102+
chromedp.SetValue(`//*[@id="j_idt183"]`, c.year, chromedp.BySearch, chromedp.NodeReady),
103103
chromedp.Sleep(c.timeBetweenSteps),
104104
// Consulta
105105
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 {
134134
var selectMonth string
135135
// O XPath para o botão de download de contracheques e indenizações é diferente.
136136
if strings.Contains(fName, "contracheques") {
137-
selectMonth = fmt.Sprintf(`//*[@id="tabelaRemuneracao:%d:j_idt201"]/span`, months[c.month])
137+
selectMonth = fmt.Sprintf(`//*[@id="tabelaRemuneracao:%d:j_idt199"]/span`, months[c.month])
138138
} else {
139139
selectMonth = fmt.Sprintf(`//*[@id="tabelaMeses:%d:linkArq"]`, months[c.month])
140140
}

0 commit comments

Comments
 (0)