хочу получить значение атрибута "data-defaultasin" в столбцах b, c, d и т. Д. Из этих элементов (приведен снимок экрана).
url- https://www.amazon.in/dp/B06XTB2N7P продукта
проверить ss страница продукта рабочий лист
Sub praseasin()
Dim ASIN
Dim doc As HTMLDocument
Dim htmTable As HTMLTable
Dim wb As Workbook: Set wb = ThisWorkbook
Dim ws As Worksheet: Set ws = wb.Worksheets("Sheet1")
Dim img As HTMLDocument
Dim i, lastRow As Long
lastRow = ws.Range("A" & ws.Rows.Count).End(xlUp).Row
For i = 3 To lastRow
Set doc = New HTMLDocument
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", ws.Cells(i, 1), True
.send
Do: DoEvents: Loop Until .readyState = 4
Dim resp
resp = .responseText
.abort
End With
' On Error Resume Next
doc.body.innerHTML = resp
Set ASIN = doc.getelementsbyclassname("swatchAvailable")
' On Error Resume Next
r.Offset(0, 1).Value = li.getAttribute("data-defaultasin")
Next
End Sub