Tampermonkey (userscript), JQuery & Vinted, aide !
jordane45 Posted messages 30426 Registration date Status Moderator Last intervention -
Good evening,
I've been stuck for a few days on a script that I'm trying to run on Vinted article pages, such as https://www.vinted.fr/items/3455924924-tee-shirt-nike-xs.
I would like to retrieve the value of the shipping fees contained in the <h3> element with the attribute: data-testid='item-shipping-banner-price'
So far, I have this little piece of code, which seems to find the h3 in question but returns undefined when I try to print its innerHTML, its .html() or its .text():
$(document).ready(function() { var pathname = window.location.pathname; if ( pathname.startsWith("/items/")) { window.addEventListener('load', function () { var isb = $("[data-testid='item-shipping-banner-price']"); alert(isb.html()); }) } }); A little help would be welcome...
Thank you! ;)
Don't forget to mark the discussion as resolved as soon as it's done! -> At the top of the page, Status: Resolved
Also, be sure to respect the 6th rule of the charter: <code>Write messages in clear language without abbreviations, telegram style or SMS mode</code>
Here's what I have:
As you can see, it returns a stop with a single value.
So you need to target the first value
Using a [0]