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
<div data-testid="x-about-this-seller">
<div data-testid="ux-section-module" >
<div >
<div >
<h2 id="ABOUT_THIS_SELLER_SECTION_MODULE0-0-1-2-title"><span >Seller information</span></h2>
</div>
</div>
<div data-testid="ux-seller-section" >
<div >
<div >
<div 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 >sapphirelondonuk</span></a><span> </span>
CodePudding user response:
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