Great that you managed to find a solution. But if you had actually read my suggestion and used Extract data from web page, you would not have needed to spend the time figuring out why your JS script doesn't work. No idea why you kept trying to do it with JS, if the method is not important to you.
Your JS will only return the first item. If you used Extract data from web page and targeted the <a> element instead of the <span>, you could retrieve the hrefs of all of the products in the page into a list.
Also, please be aware that this is a voluntary community. None of the members here (apart from some Microsoft employees) are paid to do it. We all have our personal lives and our jobs. It's not like we spend 24/7 on here just so we can answer every question. Nor must we actually provide you with an actual solution that you can copy and paste into your solution. We sometimes do, but we're not always able to. So, if you can just try out the suggestions we make, it would also make your own life easier.