0
Good morning,
I have a macro that accesses a site, enters the data and performs research, but I’m not able to make you click the "Query" button, could anyone help? Follows page HTML and macro code;
<div class="row">
<div class="col-md-4 col-xs-12">
<div class="form-group">
<button class="btn btn-primary btn-sm" onclick="check()"><i class="fa fa-search"></i> Consultar</button>
</div>
Macro
'Carrega os dados de CEP e NUM na página e pesquisa os dados informados
IE.Document.all("numero-logradouro-ins").Value = lNUM
IE.Document.all("cep-ins").Value = lCEP
For Each Button In IE.Document.getElementsByTagName("btn btn-primary btn-sm") 'FAILED
Button.Click
Next
Thank you!
See if you don’t need to trigger the event onclick(). The answer to this link provides an example for the onchange event.
– danieltakeshi
@danieltakeshi turned out I didn’t even have to call event, as the button is a class I just changed getElementTagName to getElementsByClassName("btn-Primary btn-Sm") with the name of the button class, gave it right! Thanks for the attention, hugs!
– Gustavo Freire