Hey PorterSLC,
I guess you can use text function here to find the starting and ending positions of the image URL in the HTML.
For example, you might use FIND
to find the starting position and MID
to extract the substring.
Search for the HTML Tags:
- Use
FIND
to locate the position of the HTML tags<img class="zoom-image" data-bind="click: ShowGalleryModal, attr: { src: CurrentImage.src }" src="
and"> <small>Roll over image to zoom in</small>
.
Extract the URL:
- Once you have the positions, use
MID
to extract the substring between these positions, which would be the image URL.
=MID(D2, FIND("<img class=""zoom-image"" data-bind=""click: ShowGalleryModal, attr: { src: CurrentImage.src }"" src=""", D2) + LEN("<img class=""zoom-image"" data-bind=""click: ShowGalleryModal, attr: { src: CurrentImage.src }"" src=""") + 1, FIND("""> <small>Roll over image to zoom in</small>", D2) - (FIND("<img class=""zoom-image"" data-bind=""click: ShowGalleryModal, attr: { src: CurrentImage.src }"" src=""", D2) + LEN("<img class=""zoom-image"" data-bind=""click: ShowGalleryModal, attr: { src: CurrentImage.src }"" src=""") + 1))
you might need to use VBA. a custom macro to handle the HTML parsing
Function ExtractImageURL(html As String) As String Dim startTag As String Dim endTag As String Dim startPos As Long Dim endPos As Long startTag = "<img class=""zoom-image"" data-bind=""click: ShowGalleryModal, attr: { src: CurrentImage.src }"" src=""" endTag = """> <small>Roll over image to zoom in</small>" startPos = InStr(html, startTag) endPos = InStr(startPos, html, endTag) If startPos > 0 And endPos > 0 Then ExtractImageURL = Mid(html, startPos + Len(startTag), endPos - startPos - Len(startTag)) Else ExtractImageURL = "URL Not Found" End If End Function
You can call the func in excel like this - =ExtractImageURL(D2)
If this helps kindly accept the answer thanks much.