I'm trying to do a macro and I can't find a solution for a problem. I'm using Selenium to get data from a website. Here is the HTML:
<ul class="milestones">
<li>
<img src="=" title="Red" data-pagespeed-url-hash="820105347" onload="pagespeed.CriticalImages.checkImageForCriticality(this);">
<span class="out">time 20/08/2022 12:46</span>
<strong>status Objeto aguardando retirada no endereço indicado</strong>
<br>
where it's Agência dos Correios - CONTAGEM/MG
<br>
<small>6 horas, 2 minutos atrás</small>
</li>
I want to get the time
, status
and where it is
.
The first two I was able to get using:
Cells(linha, 12).value = navegadorChrome.FindElementsByClass("milestones")(1).FindElementsByTag("span")(1).Text
Cells(linha, 13).value = navegadorChrome.FindElementsByClass("milestones")(1).FindElementsByTag("strong")(1).Text
The last I can't get, it's the part after the first <br>
.
Any help will be appreciated
on it and making a break line, i added a small code to remove after the data collection. Thanks – Fernando Barreto Aug 20 '22 at 23:21