Hello friends
I have a code to retrieve data on the web, but a problem arises. Can only take 1 url image only
my target:
1. Scrape all url images <product images> that are on the web and put in the worksheet
can anyone help me
this is my code
I have a code to retrieve data on the web, but a problem arises. Can only take 1 url image only
my target:
1. Scrape all url images <product images> that are on the web and put in the worksheet
can anyone help me
this is my code
VBA Code:
Sub scraper_Lazada()
Dim ie As InternetExplorer
Dim html As HTMLDocument
Dim URLNAME As String
Dim LastRow As Long
Dim judul As String
Dim price As String
Dim deskripsi As String
Dim highlits As String
Dim kategori As String
Dim gbr1 As String
Dim merk As String
Dim ElementCol As Object, Link As Object
Dim ecol As Long
Dim Baris_akhir As Long, i As Long
Application.ScreenUpdating = False
Set sht = ThisWorkbook
Baris_akhir = sht.Worksheets("Scraper").Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To Baris_akhir
URLNAME = Cells(i, 1).Value
Set ie = New InternetExplorer
ie.Visible = True
Application.Wait (Now + TimeValue("00:00:05"))
ie.navigate URLNAME
Do While ie.readyState <> READYSTATE_COMPLETE
Loop
'unable to verify these lines
On Error Resume Next
judul = html.getElementsByClassName("pdp-mod-product-badge-title")(o).innerText
price = html.getElementsByClassName(" pdp-price pdp-price_type_normal pdp-price_color_orange pdp-price_size_xl")(o).innerText
ganti = Replace(Replace(Replace(price, "Rp", ""), ".", ""), ",-", "")
deskripsi = html.getElementsByClassName("html-content detail-content")(o).innerText
highlits = html.getElementsByClassName("html-content pdp-product-highlights")(o).innerText
merk = html.getElementsByClassName("pdp-link pdp-link_size_s pdp-link_theme_blue pdp-product-brand__brand-link")(o).innerText
kategori1 = html.getElementsByClassName("breadcrumb_list breadcrumb_custom_cls")(o).innerText
gbr1 = html.getElementsByClassName("pdp-mod-common-image gallery-preview-panel__image")(0).getAttribute("src")
ganti1 = Application.WorksheetFunction.Substitute(gbr1, "//id-test-11.slatic.net", "https://id-test-11.slatic.net")
kategori1 = html.getElementsByClassName("breadcrumb_list breadcrumb_custom_cls")(o).innerText
Worksheets("Scraper").Cells(i, 2) = judul
Worksheets("Scraper").Cells(i, 3) = ganti
Worksheets("Sheet1").Cells(i, 1) = deskripsi
Worksheets("Sheet1").Cells(i, 2) = highlits
'Worksheets("Scraper").Cells(i, 8) = ganti1
Worksheets("Sheet1").Cells(i, 3) = kategori1
Worksheets("Scraper").Cells(i, 6) = merk
ie.Quit
Set ie = Nothing
Application.StatusBar = ""
On Error GoTo 0
Next i
End Sub