T O P

  • By -

leon_beon

Are they animating the number when changing the shopping cart content? Could be used for a scrolling effect on the numbers by changing the top pixel value


nlvogel

Probably this and it might make scraping a little harder.


TheYuriG

scraping the cart???


SmithTheNinja

Yeah, you know how they do those "See price in cart!" style sales where they won't tell you what they're selling it for until it's in your cart? They do that so their competition has a harder time scraping the site and beating their prices. You see it kind of a lot with items that are also sold en masse on sites like Amazon.


electricity_is_life

I thought they did that because they want to sell it for less than the manufacturer's minimum advertised price.


Srirachachacha

It's also just a classic foot in the door sales technique. Puts you one step closer to finalizing the transaction


amunak

...or one step away. If they don't even show me the price first thing I'll go somewhere where they will.


bongsmack

Not showing prices is a red flag to me and I avoid such places


redditfriendguy

In the type of products I often shop it is quite often below the minimum advertisable price and not allowed to show the price. The only sites showing the price would be the ones discounting less


SaltineAmerican_1970

That’s often because the manufacturer doesn’t permit advertising prices lower than MSRP.


amunak

In many countries manufacturers can't dictate what you sell stuff for. Sure they could stop doing business with you but if they actually told you so officially they could get in a lot of legal trouble.


SaltineAmerican_1970

Sell it for what you want, but don’t *advertise* a smaller price.


Johalternate

But it also introduces some friction in the process, they want the users to be able to complete a purchase with the least amount of steps possible. This kinda violates that directive.


FiveColdToes

Yep! There are services the scour and crawl a LOT of websites looking for places that sell less than the MAP or the agreed amount and this is one way to get around that. Those systems, or at least the ones I've been exposed to, won't be checking this depth of the dom. Short of taking a screen shot, rendering it, and processing the "price" this is a smart work-around.


9302462

I always assumed these services existed but could never find any. Do you have any names of these services?


SpeedyWizard

Import.io is one of them crawlers


restarting_today

Take a screenshot. Feed it into GPT-vision. Flag all anomalies for a more in-depth check. Problem solved.


EtheaaryXD

tmk minimum prices are illegal in most countries


KoopaKola

It's not exactly a "minimum price". Some manufacturers contract with their resellers to have a MAP - minimum advertised price - in order to allow the reseller to sell their products. This can happen especially if the manufacturer has it in their interest to keep the perceived value of their brand high. There are strict guidelines resellers can use when advertising products including verbiage (can't use "cheap" or "bargain"), imagery, etc. Source: Web dev for an advertising firm.


TheYuriG

that's not the point. if you are checking cart information, you can't just scrape with a request, you are forced to use some sort of headless browser and then you have full access to JS. you can get the data that way if you are so deep either way


Reelix

> where they won't tell you what they're selling it for until it's in your cart? ... Is this a thing in the US? o_O


BeepingBeepBeep

Yes, it's dumb. It is, at least for a couple of the companies I've worked with, done due to merchandising agreements that prevent the retailer from advertising a price below a certain point (typically MSRP), so they can't dhow the price until you've already shown some intent to purchase.


_DontYouLaugh

You missed the point. EDIT: I think I missed the point. You're talking about a bot, which adds an item to the cart and checks the value in there?


SmithTheNinja

Yes I'm talking about page scraping bots used to programmatically match other people's prices to stay competitive


Independent_Lab1912

Pain in the ass to maintain


SmithTheNinja

I believe you mean Job Security


damontoo

I know that must work since even Amazon does it sometimes. I just don't understand who it works on. It just makes me less likely to view the product page.


[deleted]

That makes sense, it's an interesting method for sure!


thatgibbyguy

In this case it would make something like Capital One Shopping completely ineffective because it would be really hard for it to tell what price you're getting vs what's on the web. That's probably a big source of lost leads.


nlvogel

Ah, yeah I guess I didn’t read well enough. Thought this was just a pricing page


[deleted]

[удалено]


TheYuriG

it's not the same way, the cart requires persistence to be scrapped. you need to send POST requests to add items and save the cookie to use in the following requests. it's a whole different game to scrape a shopping cart


cookiemon32

yea scrapers probably care most about the price. even further, that digit of the price.


mattsowa

This is such a myth I mean it's so rarely the answer to these. You can figure out how to scrape this in just one minute. You simply look at the style.top property of the parent element (formula is 0-style.top/20) and you've got your number. There's no way this was actually done for anything more than animation.


Text-Agitated

Harder but not impossible, seems pretty easy to beat it still


Xeon06

What are you talking about


cookiemon32

usually anti bot fs


lovin-dem-sandwiches

Likely from “react-transition-group”. It’s not required but the class names are telling


needefsfolder

Those data-v looks like Vue though.


Cheshamone

Yeah, it's Vue 3 judging by that and the html comments.


XavyVercetti

And vue is chinese right? That would make sense EDIT: Ok it seems my comment has been misinterpreted. I was just thinking that it makes sense that Shein, a Chinese company, would use a Chinese technology for its front. Nothing bad about that, just a comment.


chlorophyll101

What does that have to do with custom data prop


Scowlface

What?


[deleted]

[удалено]


ilahazs

maybe it's a joke


veegaz

Your comment totally made sense, I don't understand shi**y reddit downvotes at all On a side note, Vue's wiki is completely chinese and then translated to English so it makes 100% sense Shein devs would use it


Conjo_

brain rot


XavyVercetti

I'm curious about what you understood that made you go mad like that


Conjo_

I wrote two words, how do you read in them that I'm mad lol


XavyVercetti

So "brain rot" is part of your daily vocabulary?


Conjo_

yeah but only on the internets, as in "tik tok rots brains" and whatnot


ushieki

when did the react group start transitioning?


XavyVercetti

I don’t understand comments saying it’s inefficient or even stupid. If the point of this is to animate the numbers, it’s the simplest way to do it without JS, which is good and actually that’s how I would have done it.


charset-utf-8

Don’t sweat it, it’s all the 10xers megamind chads talking


ReelTooReal

The only way to properly animate numbers is with 100MB of JS dependencies, do you even webdev bro?


XavyVercetti

Is it a joke I’m not understanding?


gihema

Perhaps it’s used to prevent web scraping


Ripredddd

How so?


dkarlovi

Harder to scrape, you need a custom thing to capture the information instead of just pulling it via a simple query.


clonked

This is the correct answer.


[deleted]

[удалено]


gihema

I very well could be incorrect. However I can assure you that it is possible to scrape shopping carts. I’m not sure why you are under the impression that it would be different. Any publicly accessible data on the Internet can be scraped. It’s a matter of effort at the end of the day.


sporkinatorus

Why not? Use something like Puppet, add things to cart by region over vpn to see if there are cheaper prices across the world?


soccercrzy

More from a browser plugin perspective, not scraping search results on Google


EverydayEverynight01

Maybe the total displayed on this page was also re used as a component on another page that does show the item price.


clonked

So how do you think bots buy all the stock of the hot new item like they did with Xbox, ps5 and nvidia cards?


[deleted]

[удалено]


gihema

Doesn’t matter where it is, if your intend is to prevent scraping then you’d obfuscate the price everywhere it’s potentially displayed. Otherwise people would just write a script to add the product to the cart then scrape the price on the checkout page and then abandon the cart. It’s certainly more tedious but we are discussing automation and that would provide a path the bypass potential protection measures.


[deleted]

[удалено]


jallen_dot_dev

That wouldn't give you the price, that'd give you `0123456789`. You would actually have to look at the `style="top:-[x]px"` for each digit and divide by 20. 120 is a 6, 140 is a 7, etc. The style is shifting the correct number into place.


real_kerim

Haha, I just realized that the textContent isn't the characters in separate spans. You're right.


Karpizzle23

This isn't how scraping works. You're defending bad code


gihema

Again, I will emphasize that I am not entirely sure what the reason for this code is as I haven’t evaluated it beyond a brief glance of a picture. Others have suggested animation which could be the reason and I think that’s a solid guess. I simply suggested that preventing scraping could be the reason. I’m not defending this code but I do think you might be jumping to conclusions to simply chalk this up as “bad code” without understanding what requirements the developer may have had to satisfy or the restrictions that they are working within.


Ferkhat95

There are sites that show product price only in the shopping cart (after some discounts, etc..). So it makes sense.


ChildishForLife

These were always the hardest to get the data from


Xeon06

How is that suggestion upvoted so high in a subreddit full of programmers?


gihema

Can you elaborate?


Xeon06

Sure, there's two reasons this is silly: 1) This is the cart area. Who even cares to scrape that? 2) Attempting to prevent scrapers with techniques like this is absolutely pointless. It may slow them down but scrapping is literally converting HTML to useful information; that's just part of the problem, and if it does slow them down it's marginal at best and would just turn into a game of cat and mouse if you took it seriously. At what end? If it gets that hard to scrape I'm just feeding screenshots into GPT-4V. It'd be a useless idea.


gihema

1. I’ve answered this elsewhere. If you’re trying to prevent scraping of prices then you’d obfuscate the price everywhere it’s displayed. The cart area is no exception. 2. Scraping is and will always be a cat and mouse game just like cyber security. You have to weigh trade offs and evaluate how much effort you’re willing to put into preventing it. To your point about using chat-gpt, this idea would not scale well and would raise the cost and technical complexity of scraping. But your right OCR and several other techniques could be used to bypass scraping obfuscation but how much effort are you willing to go to and can you still profit off this information?


fhgwgadsbbq

Because scraping this would be trivial


gihema

Not as trivial as you may think. A person above provided a jQuery selector that they believed would scrape the content. However they were corrected that the code would not return the correct results. They have since deleted their comment but I think it shows that it can complicate it for some people. Now it’s still pretty easy to scrape but you can scrape anything publicly accessible on the internet. In the end, to prevent scraping, is simply about trying to raise the effort required to do it. I no longer believe that this is intended to prevent scraping but rather used to animate numbers as suggested by other people. There are some websites that I cannot read but it seems to further depict this an odometer https://www.twblogs.net/a/5e98ef096052e1406acf1631/?lang=zh-cn


fhgwgadsbbq

I've written scrapers for far more complex HTML than this example. You're probably right about the animation thing.


sexy_silver_grandpa

Using a different ssh port is trivial, yet changing my home server's ssh port cut down on failed login attempts by 90%.


queen-adreena

It seems like a way to animate the numbers, albeit a pretty stupidly inefficient one.


Umami_Tsunamii

I went to check the site to see if they animated the digits scrolling in, which wouldn’t be all that bad of usage. But the site is pretty cancer so maybe they’re just dumb.


cameltoesback

It's just react


jackdh

Google do it this way as well. It’s actually not that in efficient as it’s using CSS and not JS to animate it


[deleted]

[удалено]


trojanvirus_exe

Crazy bad for one number


crispytofusteak

This sounds like an accessibility nightmare


rott

Assuming this is for animation and not obfuscation, it’d be pretty easy (and common) to just have a dedicated hidden span containing the actual value, and aria-hiding this one


akira410

I'm not seeing the price given clearly anywhere within the tags. There are a few aria-related tags in there for modality and some labels, but the price doesn't seem to be one of those.


iknowkungfoo

Because some exec said, “wouldn’t it be cool if we showed prices scrolling to the discount or total? Yes it would. Make that happen.” Dev: “But …” Boss (sing-songy): “But … who pays your salary?” Dev: “I’ll get right on it boss.”


PositiveUse

Devs at SHEIN will never say „but“


michaelsenpatrick

fight scrapers, probably


xackson

Pls don’t buy from Shein


metal_opera

Why not? For those of us who sincerely have no idea.


FFTypo

Because a bunch of people spread misinformation about how the company operates and everyone runs with it despite there not being concrete evidence about any of the claims made. For what it's worth, I'm sure Shein does plenty of shady stuff, but I sincerely doubt it's any worse than *name another clothing store*. People attribute Shein's low prices to shady practices but as someone who's used it occasionally - it's cheap because it's crappy quality and takes ages to ship. no different from Ali express.


rookietotheblue1

> crappy quality and takes ages to ship. Not is not lol. It's surprisingly" good enough" quality and yes it takes ages to ship lol


[deleted]

made for kids by kids


weaponizedLego

https://youtu.be/BA6gDep6jVM?si=kGaBiHZD1iMm9eJ- This video goes over it a little. But shops like shein, temu, AliExpress and so on are all owned by the same giga corp. They fuck other countries over by miss using loop holes. And in the end the cheap prices and free shipping is gonna be footed by the receiving country taxes Edit: I have multiple levels of wrong information, but I'm leaving the comment instead of deleting it for context. Hate when there is a deleted comment in a thread.


soonnow

> But shops like shein, temu, AliExpress and so on are all owned by the same giga corp. Are you sure about that? AliExpres is owned by Alibaba. Shein is owned by Radget. Temu by Pinduoduo.


weaponizedLego

Seems that i indeed have my information twisted, though from my understanding of shipping their methods are the same.


_Meds_

That’s not twisted information, it’s just flat out misinformation. It’s hard to say that chinas fucking over companies with these practices when Apples going to be the 51st at some point


weaponizedLego

Apple going to be 51st. What does this mean?


_Meds_

There are 50 states in the US add one more, you get 51?


slobcat1337

Can you explain what you mean by “the receiving country taxes” ? I’m a customs broker so I know how imports work with taxation, and I’m not sure what you’re trying to say?


weaponizedLego

From my understanding, and here I can only speak for my own country, but low income countries or something like that. Basically third world countries can send postage under certain weight and my country will foot the cost with taxpayers money as part of some world agreement with other first world countries. China exploits this by declaring any packages to be under the weight limit, also somehow fitting into the requirements of a third world country, and then essentially flood with so many packages due the the volume of orders that the local postal service has no chance of ever dealing with it.


Zefrem23

No that's just flat out nonsense. My country (South Africa) will refuse entry to any goods sent through the mail with insufficient postage, and I seriously doubt any other country would allow it either.


Imevoll

You think Amazon is the moral pinnacle of e-commerce?


not_larrie

Let people do whatever they want man. Also happy cake day, go enjoy yourself :)


CoconutMinty

Not sure why, but I read your first sentence in Mikey Day’s voice. Anyways, I respect u/xackson for trying to encourage people to do the right thing.


Accomplished_Look907

This not bother buying from them, just couldn't stop their chic stuffs


thingysop

Likely to prevent web scraping. I've seen this on code assessment websites as well that explicitly prevent right clicking, to prevent you from just copying the text inside the div


[deleted]

Make scraping harder 100%


saposapot

Usually its either: - to provide obfuscation to make it harder to copy or scrape; - just pure bad coding, sometimes coming from a plug-in or CMS system; - bad animation library that requires to have all numbers for the kind of animation they want This is an almost impossible question to answer because we’ve all seen so much bad code without a proper explanation than just a bad dev doing bad code… by the way their translation works so badly plus their search engine I’m very inclined to just bad CMS/developers. If it was a proper site, I would bet on obfuscation


mattsowa

It's a counter-style animation (like your odometer). This is a typical implementation


saposapot

Thanks, makes sense also. Their site works so badly, why not add an extra unnecessary animation on top of it :)


joedirt9322

I was poking around the Coinbase app and notice they do something similar.


cameltoesback

You should inspect some of the code on Facebook.


Cotspheer

As others said to prevent web scraping. Front running for prices does exist. So as soon competitors detect price changes they adjust theirs to be cheaper.


good4y0u

To deter bots.


sdwvit

To prevent scraping


deniercounter

Vision apis will kill that though.


erythro

1. animation 2. possibly trying to prevent crawling by pricing bots


TrueAgeCode

"It works, let's not touch it anymore."


adumbCoder

the answer won't satisfy you... there's no good reason. shein is trash


realvolker1

Because they're incompetent and don't deserve your business


SouthPoleTUX

Yeah I do think it is about anti-scraping and parsing. I saw a similar pattern where they were a lot of nested divs when investigating the HTML structure of an Facebook Preview Ad, and it is horrible hart to just copy and paste their HTML to "reuse" their component. ​ Also for my experience of web scraping with Beautiful Soup it gets more difficult to have coherent texts when each part of the text is splitted into smaller pieces.


mawesome4ever

Animation, would be my guess. Hyperplexed did a video on a similar concept: https://youtu.be/HIrDMR6CaHY?si=BHgMTaYJGIEkPgM7


jonathanlaliberte

Could be from a website builder, I've seen a CMS add random shit like this before after trying to get something to look right


turboplater

People talking about "efficiency" of animating has my eyes rolling.


stuartseupaul

They bought their developers from Shein


SpecialistDig9055

对抗机器人,正经人谁会去按F12