Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
#70641
Boa tarde!
Preciso de ajuda estou desenvolvmento um script VBA que o inyuiyo é colher informações de um determinado site da web, porém me deparei com um problema eu preciso pegar o ultimo dado de uma tabela que contém informações importantes porém não estou conseguindo, alguém pode me ajudar?
Código: Selecionar todos
ul = Range("A1000000").End(xlUp).Row
    
    For inicio = 2 To ul
        Navegador.FindElementById("ordemServico").SendKeys Range("A" & inicio).Value
        Application.Wait (Now + TimeValue("00:00:01"))
        Navegador.FindElementByXPath("/html/body/div/div[3]/div/form/table/tbody/tr[2]/td/input").Click
        Application.Wait (Now + TimeValue("00:00:01"))
        Range("B" & inicio).Value = Navegador.FindElementByXPath("/html/body/div/div[3]/div/form/table[2]/tbody/tr[2]/td[5]").Attribute("innerText")
        Application.Wait (Now + TimeValue("00:00:03"))
        Navegador.FindElementByCss(".branco > td:nth-child(6) > a:nth-child(1)").Click
        Navegador.FindElementByCss("#formConsultarOrdemServico > div:nth-child(5) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > a:nth-child(2)").Click
        'Range("C" & inicio).Value = Navegador.FindElementByClass("dados esquerda").FindElementByClass("Data e Hora")(-1).Attribute("innerText")
        'Set tb = Navegador.FindElementByXPath("/html/body/div/div[3]/div/form/div[4]/table/tbody/tr[13]/td[1]")
        Navegador.FindElementByXPath("/html/body/div/div[3]/div/form/div[1]/table/tbody/tr/td[1]/a").Click
        Navegador.FindElementById("ordemServico").Clear
    Next inicio
    MsgBox ("Verificação concluída!")
Imagem

I minha duvida está na linha:
Código: Selecionar todos
'Range("C" & inicio).Value = Navegador.FindElementByClass("dados esquerda").FindElementByClass("Data e Hora")(-1).Attribute("innerText")
Quero obter o ultimo dado das Colunas Data e Hora e Ocorrencia
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord