Chrome-Dev-Tool :- csm-hit cookie in Amazon

被刻印的时光 ゝ 提交于 2019-12-11 01:27:19

问题


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.

  1. 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.

  2. 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.

来源:https://stackoverflow.com/questions/54962418/chrome-dev-tool-csm-hit-cookie-in-amazon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!