In one product, there are several choices of product variations such as color and size
this is the site https://shopee.co.id/sepatu-gunung-...utdoor-touring-beckham-i.234869233.4319432435
can someone help improve my code
I want to get data :
price variations
stock variations
size and color variations
this is the site https://shopee.co.id/sepatu-gunung-...utdoor-touring-beckham-i.234869233.4319432435
can someone help improve my code
I want to get data :
price variations
stock variations
size and color variations
VBA Code:
Sub trial()
Dim Ie As InternetExplorer
Dim html As HTMLDocument
Dim URLNAME As String
Dim sht As Worksheet
Dim stock As String
Dim tag As Object
Dim price As String
Dim EndRow As Long, i As Long 'ADDED
Set sht = ActiveSheet
EndRow = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
For i = 3 To EndRow
URLNAME = Cells(i, 1).Value
On Error Resume Next
Set Ie = New InternetExplorer
Ie.Visible = true 'to allow you to see what is going on
'Application.Wait (Now + TimeValue("00:00:05"))
Ie.navigate URLNAME
On Error Resume Next
Do
DoEvents
Application.Wait (Now + TimeValue("00:00:05"))
Loop Until Ie.readyState = READYSTATE_COMPLETE
Set html = Ie.document
On Error Resume Next
price = html.getElementsByClassName("AJyN7v")(0).innerText
For Each tag In html.getElementsByClassName("flex items-center _2_ItKR")
stock = tag.getElementsByTagName("Div")(1).innerText
Next
Sheet3.Cells(i, 4) = price
Sheet3.Cells(i, 5) = stock
Ie.Quit
Set Ie = Nothing
Application.StatusBar = ""
On Error GoTo 0
Next i
End Sub