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.
#54682
Olá pessoal.

Tenho um código para fazer a extração de dados de um site e alocá-los em uma planilha, no entanto não estou conseguindo configurar o comando para extrair uma atributo específico.

Esse é o código usado atualmente:
Código: Selecionar todos
Sub Coleta()
On Error Resume Next

Dim ie As Object
Dim iLin As Long
Dim vSite As String

Set ie = CreateObject("internetexplorer.application")
ie.Visible = False
vSite = "https://www.walmart.com/ip/Jetson-Rave-Extreme-terrain-Hoverboard-with-cosmic-Light-up-wheels/968552346"
ie.navigate vSite
Do While ie.busy
Loop

iLin = 2
Set tabela = ie.Document.all.tags("span")
For I = 0 To tabela.Length - 1
vSite = tabela.Item(I).innerText
If vSite <> "" Then
If Cells(iLin, "A") = "" Then
Cells(iLin, "A").Value = vSite
iLin = iLin + 1
End If
End If
Next
ie.Quit
End Sub
A informação que eu preciso buscar em parte do código é:

<div data-linktype="" class="hide-content display-inline-block-m valign-middle secondary-info-margin-right copy-mini"><a href="/tp/jetson" class="prod-brandName"><span itemprop="brand">Jetson</span></a></div>
<div tabindex="-1" class="valign-middle secondary-info-margin-right copy-mini display-inline-block wm-item-number">Walmart # </div>
<span itemprop="gtin13" content="0811991030569"></span>
</div>

Desde já agradeço muito pelo tempo de vocês.

Abraços.
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