关于cookies中的utmc,utmb,utma,utmz,utmv各代表什么,麻烦高手帮忙解答

由于第一次研究cookie,在分析校内的cookie的时候,遇到了一些__utma utmz的Name,参数的内容完全分析不懂,经多方求教,终于知道了原来那些代码竟然是Google的免费网站统计系统产生的信息(垃圾代码害得我浪费了整整一天),Down下来了它的生成文件:Urchin.js 几千行代码看的我脑袋发木,最后百度搜索寻求不到结果,求助于Google,才得到了如下的信息:

    This article/section is a stub.
    It is here because it was planned, created to drop some preliminary notes. Statements may be wrong, and the style and structure may suck. Feel free to add further notes or suggestions, rewrite sections or the whole into something understandable.

    The cookies named:

        __utmv is used for user-custom variables in Analytics

    __utma
    __utmz

    ...and others are part of Google Analytics, specifically the Urchin tracking module. These cookies track usage on sites that use Google Analytics.

Some details:

        __utmz tracks where a visitor came from (search engine, search keyword, link)

        __utma tracks each user's amount of visits, first, last visit.

        __utmb and __utmc are used to track when a visit starts and ends to some decent time resolution (c expires quickly). If you look at cookie state changes (e.g. using firecookie), you will see these change a lot .

如上,英文的内容实在让人看得头痛,下面简要翻译下各个参数的内容:

__utmz:跟踪访问者是从哪里来的(搜索引擎,搜索关键字,链接地址);

__utma:跟踪每个用户的大量访问,第一次,最后一次;

__utmb和__utmc是跟踪每个用户的访问时间,从开始到结束。
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
import requests import time from bs4 import BeautifulSoup header={ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 SLBrowser/8.0.0.12022 SLBChan/25', 'Host':'zhuti.xiaomi.com', 'Referer':'http://zhuti.xiaomi.com/lockstyle?page=2&sort=New', 'Cookie':'uiversion=5; __utmz=219621008.1672838090.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=219621008; JSESSIONID=aaapDywvYNfz79fBMiKRx; __utma=219621008.621547792.1672838090.1672886725.1672916631.3; route=ea4585473b17eff20a466a6aa9314dcc; __utmb=219621008.4.10.1672916631', 'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' } headers={ 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 SLBrowser/8.0.0.12022 SLBChan/25', 'sec-fetch-dest': 'document', 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' } def down1(): for i in range(1,5): url="http://zhuti.xiaomi.com/lockstyle?page="+str(i)+"&sort=New" down2(url) def down2(neirong): r=requests.get(neirong,headers=header) r.encoding="utf-8" print(r.status_code) demo=r.text print(demo) down3(demo) def down3(biaoqian): soup=BeautifulSoup(biaoqian,"html.parser") tags=soup.find_all("img") print(len(tags)) print(tags) for tag in tags: image=tag["data-src"] print(image) down4(image) def down4(shuchu): filename="image/"+str(int(time.time()*1000))+".jpg" r=requests.get(shuchu,headers=headers) f=open(filename,"wb") f.write(r.content) f.close() if __name__=="__main__": down1()
07-09

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值