Olá amigos, estou tentando automatizar um trabalho em minha empresa, e segue o seguinte:
Sub AutomatizarConsignet()
Dim IE As Object
Dim URL As String
Dim Matricula As String
Dim Margem As String
Dim Linha As Long
URL = "https://www.www1.consignet.com.br"
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate URL
Do While IE.Busy Or IE.ReadyState <> 4
DoEvents
Loop
IE.Document.getElementById("username").Value = "user"
IE.Document.getElementById("password").Value = "password"
IE.Document.getElementById("login-button").Click
For Linha = 2 To Cells(Rows.Count, 4).End(xlUp).Row
Matricula = Cells(Linha, 4).Value
IE.Document.getElementById("id="search-funcionario-matricula" type="text" class="MuiInputBase-input MuiInput-input MuiInputBase-inputAdornedEnd MuiInputBase-inputMarginDense MuiInput-inputMarginDense" value="">).Value = Matricula
Margem = IE.Document.getElementById(<span class="MuiButton-label"><div data-testid="button-flex" margin="0" padding="0" class="sc-bdVaJa hxPKEK">CALCULAR MARGEM</div></span>).Value
Cells(Linha, 6).Value = Margem
Next Linha
IE.Quit
Set IE = Nothing
End Sub
apesar disso os parametros não estão dentro do esperado, acaba pegando coisas que não tem nada a ver com o desejado, quando realizo da forma arcaica da certo, porem não funciona programando, pois fica com os padrões errados.
o que fazer? alguma dica? consiste em utilizar este site e o excel numa simples planilha.