I'm trying to set cookies while scraping Amazon to not get caught and look like an authentic user.
I'm trying to replicate the behaviour of the website. I've completely analyzed the headers, the request and response signatures etc. The only thing which change is cookies
, and that too csm-hit
and visitCount
. I understood the logic behind visitCount
getting updated, but not csm-hit
.
Here's the csm-hit
cookie.
tb:s-Y4SB9X78SYQB53MGCQWE|1551555477343&t:1551555479805&adb:adblk_no
It is of the below format:-
tb:s - ALPHANUMERIC | EPOCH_TIME &t EPOCH_TIME &adb:adblk_no
This alphanumeric characters (which looks like base64 encoded) keep changing. It calls a function updateCsmHit
when reloading/redirecting out of the amazon, which then updates the csm-hit
value and then re-use the same updated value next time when the request is being made to the server. If this cookie is not already saved in the browser, it does not send csm-hit
in the request, but saves it the moment we step out of Amazon.
I've anlyzed the complete source code using Chrome Dev tool, but unable to crack the logic of generating this alphanumeric value.
I want to understand how this value is being generated so that I can use the same logic to replicate its generation? Can anyone please help me in this regard by using Chrome Dev tool.
Does anyone know the significance of
csm-hit
?
PS: Please don't advise me to use the same csm-hit
everytime. I want to know how is this getting generated.