I have a site from which I can extract data, but I am facing issues with image extraction as the URLs are not in the proper format. Suggestions are required for extracting the URLs in the correct format.My working code is following but output url is not proper.Page url is
https://tjmaxx.tjx.com/store/jump/product/Waterproof-Hiking-Boots/1000935805?rrec=true&cs=PDP
My following code is extracting image but url is not proper
Dim imgs As String
imgs = d.FindElementByXPath("/html/body/div[4]/div/div/div[2]/section/div[1]/div[1]/ div").Attribute("innerHTML")
If imgs = "" Then
imgs = d.FindElementByXPath("/html/body/div[2]/div/div/div[2]/section/div[1]/div[1]/div").Attribute("innerHTML")
End If
'MsgBox (imgs)
img = CountChrInString(imgs, "img src")
'MsgBox (img)
For i = 1 To img
img1 = d.FindElementByXPath("/html/body/div[4]/div/div/div[2]/section/div[1]/div[1]/div/ul/li[" & i & "]/a/img").Attribute("src")
If img1 = "" Then
img1 = d.FindElementByXPath("/html/body/div[2]/div/div/div[2]/section/div[1]/div[1]/div/ul/li[" & i & "]/a/img").Attribute("src")
End If
If imgall = "" Then
imgall = img1
Else
imgall = imgall & "," & img1
End If
Next
15