I'm trying to pull the seller link from ebay uk. The current code below used to work fine, when it was using this class ("mbg"), now it still works but does not extract most of the urls, this is due to the CLASS change. I have tried several Class variations but nothing seems to work.
Can someone please have another look and ID the correct Class, as I said the current class does work and it was the old class, so the result currently are hit and miss, more miss. See image below
Url - Ebay Product Link
counter = 0
For Each link In varLinks
DoEvents
Set doc = NewHTMLDocument(CStr(link))
If doc.getElementsByClassName("mbg")(0) Is Nothing Then
wsSheet.Cells(StartRow + myCounter, 2).Value = "-"
Else
wsSheet.Cells(StartRow + myCounter, 2).Value = doc.getElementsByClassName("mbg")(0).Children(0).href
End If
<div class="vim x-about-this-seller" data-testid="x-about-this-seller">
<div data-testid="ux-section-module" class="ux-section-module">
<div class="section-title">
<div class="section-title__title-container">
<h2 class="section-title__title" id="ABOUT_THIS_SELLER_SECTION_MODULE0-0-1-2-title"><span class="ux-textspans--BOLD">Seller information</span></h2>
</div>
</div>
<div data-testid="ux-seller-section" class="ux-seller-section">
<div class="ux-seller-section__content">
<div class="ux-seller-section__item">
<div class="ux-seller-section__item--seller" data-testid="ux-seller-section__item--seller">
<a href="https://www.ebay.co.uk/usr/sapphirelondonuk?_trksid=p2047675.m3561.l2559" data-testid="ux-action" _sp="p2047675.m3561.l2559" data-vi-tracking="{"eventFamily":"ITM","eventAction":"ACTN","actionKind":"CLICK","operationId":"2047675","flushImmediately":false,"eventProperty":{"parentrq":"efab2f12f8ce13e8","pageci":"fe5eef83-63b4-4f4f-b6a8-afcb8e69891d","moduledtl":"mi:3561|li:2559","sid":"p2047675.m3561.l2559"}}"><span class="ux-textspans--PSEUDOLINK ux-textspans--BOLD">sapphirelondonuk</span></a><span> </span>
Its ok I have worked it out its
wsSheet.Cells(StartRow + myCounter, 2).Value = doc.getElementsByClassName("ux-seller-section__item")(0).getElementsByTagName("a")(0).href