当前位置: 首页 > news >正文

学做网站能赚多少快速优化关键词排名

学做网站能赚多少,快速优化关键词排名,江宁网站建设方案,海南网络一、抓包第一次请求 url aHR0cDovL2N5eHcuY24vQ29sdW1uLmFzcHg/Y29saWQ9MTA抓包#xff0c;需要清理浏览器cookie#xff0c;或者无痕模式打开网址#xff0c;否则返回的包不全#xff0c;依照下图中的第一个包进行requests请求 第一次请求后返回 !DOCTYPE html…一、抓包第一次请求 url aHR0cDovL2N5eHcuY24vQ29sdW1uLmFzcHg/Y29saWQ9MTA抓包需要清理浏览器cookie或者无痕模式打开网址否则返回的包不全依照下图中的第一个包进行requests请求 第一次请求后返回 !DOCTYPE htmlhtml xmlnshttp://www.w3.org/1999/xhtmlheadmeta http-equivContent-Type contenttext/html; charsetUTF-8/meta http-equivCache-Control contentno-store, no-cache, must-revalidate, post-check0, pre-check0/meta http-equivConnection contentClose/script typetext/javascriptfunction stringToHex(str){var val;for(var i 0; i str.length; i){if(val )val str.charCodeAt(i).toString(16);else val str.charCodeAt(i).toString(16);}return val;}function YunSuoAutoJump(){ var width screen.width; var heightscreen.height; var screendate width , height;var curlocation window.location.href;if(-1 curlocation.indexOf(security_verify_)){ document.cookiesrcurl stringToHex(window.location.href) ;path/;;}self.location /Column.aspx?colid10security_verify_data stringToHex(screendate);}/scriptscriptsetTimeout(YunSuoAutoJump(), 50);/script/head!--2023-10-11 11:55:23--/html其中stringToHex方法用于将字符串转换为十六进制表示 function stringToHex(str) {var val ;for (var i 0; i str.length; i) {if (val ) val str.charCodeAt(i).toString(16);else val str.charCodeAt(i).toString(16);}return val; }用python实现 def stringToHex(data):valu for i in range(0, len(data), 1):# 获取字符串中索引为 i 的字符的 Unicode 值并转换为十六进制字符串表示unicode_value ord(data[i])val hex(unicode_value)[2:] # [2:] 是为了去掉十六进制字符串前面的 0x 前缀valu valu val # 顺序不能反否则转换的十六进制是倒着的return valuYunSuoAutoJump()方法设置了cookies中的一个srcurl值还有第二次请求的url function YunSuoAutoJump() {var width screen.width;var height screen.height;var screendate width , height;var curlocation window.location.href;if (-1 curlocation.indexOf(security_verify_)) {document.cookie srcurl stringToHex(window.location.href) ;path/;;}self.location /Column.aspx?colid10security_verify_data stringToHex(screendate); }screendate是定值因此 url2 url security_verify_data313232302c363836二、第二次请求 观察浏览器抓到的第二个请求的cookies 发现cookies中除srcurl还有security_verify_data与第一次请求对比发现在第一次请求时携带security_verify_data如下图 因此第二次请求的cookies为 headers1 resp1.headers.get(Set-Cookie) result headers1.split(;)[0] cookies {} key, value result.split() cookies[key] valuekey srcurl value stringToHex(url) cookies[key] value进行第二次请求返回 !DOCTYPE htmlhtml xmlnshttp://www.w3.org/1999/xhtmlheadmeta http-equivContent-Type contenttext/html; charsetUTF-8/meta http-equivCache-Control contentno-store, no-cache, must-revalidate, post-check0, pre-check0/meta http-equivConnection contentClose/ scriptvar cookie_custom {hasItem: function(sKey) {return (new RegExp((?:^|;\\s*) encodeURIComponent(sKey).replace(/[\-\.\\*]/g, \\$) \\s*\\)).test(document.cookie);},removeItem: function(sKey, sPath) {if (!sKey || !this.hasItem(sKey)) {return false;}document.cookie encodeURIComponent(sKey) ; expiresThu, 01 Jan 1970 00:00:00 GMT (sPath ? ; path sPath : );return true;} };function YunSuoAutoJump() {self.location aHR0cDovL2N5eHcuY24vQ29sdW1uLmFzcHg/Y29saWQ9MTA;} /script scriptsetTimeout(cookie_custom.removeItem(srcurl);YunSuoAutoJump();, 50);/script/head/html 由返回可知第三次请求的url与第一次请求一致cookies要除去第二次请求的srcurl这个键再与浏览器中的第三次请求进行对比。 cookies中多了security_session_mid_verify这个键同理可知这个值在第二次请求的Set-Cookie处取得cookies如下 headers2 resp2.headers.get(Set-Cookie) key, value headers2.split(;)[0].split() cookies[key] value cookies.pop(srcurl) # 删去srcurl键值对三、第三次请求 resp3 requests.get(url, headersheaders, verifyFalse, cookiescookies).content此网站如果使用requests.get().text返回的内容不对所以用content查看返回内容发现是乱码部分如下 \xe5\x9b\xbe\xe7\x89\x87\xe6\x87\x92\xe5\x8a\xa0\xe8\xbd\xbd\r 先解码再删去返回中的\r即返回正文内容 text resp3.decode().replace(\r, )
http://www.dnsts.com.cn/news/63842.html

相关文章:

  • 遵化建设招标网站wordpress手机版边侧导航
  • 怀来网站建设在线二级域名子域名查询
  • 临沂网站服务器价格合肥优秀网站建设
  • 网站推广有用吗?欧洲大型服务器
  • 企业网站建设思路网站推广软件排名
  • 网站推广代运营多少钱创业网项目招商
  • 长安镇网站建设个人网站设计论文道客巴巴
  • 建设网站ppt深圳前海网站设计
  • 做网站上海的备案地址深圳龙华新区住房和建设局网站
  • 漯河住房和城乡建设局网站线上营销推广
  • 许昌企业网站建设公司模拟人生4做游戏下载网站
  • 网站开发安装环境公司地址怎么免费上地图
  • 太原市免费网站建设宜宾三江新区核酸检测
  • 做网站asp用什么软件制作网页如何给背景设置颜色
  • 七台河做网站最近最新手机中文大全8
  • 怎么在电脑上自己做网站吗上海城隍庙景点介绍
  • 龙岩网站建设全包推广引流的方法
  • 赣州北京网站建设遂溪网站建设公司
  • 网站建设基本流程视频wordpress怎么写root.txt
  • 网站入股云建站广东建设工程执业资格注册中心网站
  • 娱乐网站建设公司怎样拓展客户
  • 湖南岳阳网站网站开发者工作描述
  • 做肯德基玻璃门网站商丘网站优化
  • 哪家做网站的比较好做a的视频在线观看网站
  • 自己能注册网站吗做网站的公司吉林
  • 英文网站策划怎么样模仿网站
  • 网站没有做301的后果是什么合肥网站优化seo
  • 做网站源码流程网站建设大约多长时间
  • 济南seo网站推广百度关键词排名突然下降很多
  • 网站如何做搜索wordpress不提示系统更新