没有合适的资源?快使用搜索试试~ 我知道了~
首页解析百度搜索结果link?url=参数分析 (全)
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/13062594/bg1.jpg)
解析百度搜索结果解析百度搜索结果link?url=参数分析参数分析 (全全)
自从9月后百度和360开战的结果就是 百度搜索结果的网址改变了,变成link?url=………这样的重定向格式了。
看到这样的不友好的URL真有破解的冲动。于是今天开始试试破解它
前几天写过一篇可以获取到百度跳转之后的网址的文章,在百度了一下,有人也研究过百度link?url=的。
大概得出如下结果:大概得出如下结果:
1、加密方式根据:随机+输入停留时间+快照地址进行加密
2、整个代码中应该有三个部分:1、搜索词的时间;2、搜索的关键词;3、随机生成的唯一性标识代码。
3、在任何环境或浏览器下 url=最后有一段相似的代码
从以上别人研究的结果可以知道,“最后有一段相似的代码”是比较可用的,于是先从此入手。
我搜索“enenba” 发现,我的第一个搜索结果的URL都有一段代码是相同的,那就是
http://www.baidu.com/link?url=…………ebac5573358cc3c0659257bfcf54763ec1c5ecff3b3fbd1d4c
所有搜索结果都有的一段代码 ebac5573358cc3c0659257bfcf54 (搜索N次后发现)
后面结尾的 763ec1c5ecff3b3fbd1d4c 看起来像是搜索结果的真实URL。(已经验证是真实URL的密文)
我是这样验证的:
1、先百度搜索 www.php100.com
第一个结果链接:
http://www.baidu.com/link?url=…………ebac5573358cc3c0659257bfcf546427d385fef6656de2404d6843da27
看到前面的几位6427d385fef6656de2404d6843da27
2、 再百度搜索 www.hao123.com
第一个结果链接:
http://www.baidu.com/link?url=…………ebac5573358cc3c0659257bfcf54 6427d385e6ff7a6de0434d6843da
看到前面的几位6427d385e6ff7a6de0434d6843da
……
多次搜索N个网站后发现,域名前几位是“www.”的,密文是都是6427d385
并且www.是四个字符,密文6427d385是八个字符。可以知道密文两个字符等于url一个字符。
于是写了一个php表单查询并得到密文部分,方便以后查看。
出个php源码:
复制代码 代码如下:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>查询百度link?ulr=真实链接表单</title>
</head>
<body>
<?php
/*
getrealurl 获取301、302重定向后的URL地址 by enenba.com
@param str $url 查询
$return str 定向后的url的真实url
*/
function getrealurl($url){
$header = get_headers($url,1);
if (strpos($header[0],'301') || strpos($header[0],'302')) {
if(is_array($header['Location'])) {
return $header['Location'][count($header['Location'])-1];
}else{
return $header['Location'];
}
}else {
return $url;
}
}
$input = '<form method="get" action=""><input type="text" name="url" id="url" style="width:800px;" /><input type="submit"
value="提交" /></form><body></html>';
$url = isset($_GET['url'])?$_GET['url']:'';
if(empty($url)) exit($input);
$urlreal = getrealurl($url);
echo '真实的url为:'.$urlreal;
$urlreal = ltrim($urlreal,'http://');
$search = '/ebac5573358cc3c0659257bfcf54([0-9a-f]+)/i';
preg_match($search,$url,$r);
$url_encode = $r[1]; unset($r);
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
import requests import re headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36'} def baidu(page): num = (page - 1) * 10 url = 'http://www.baidu.com/s?ie=utf-8&medium=0&rtt=1&bsst=1&rsv_dl=news_b_pn&cl=2&wd=meizu&tn=news&rsv_bp=1&rsv_sug3=16&rsv_sug1=6&rsv_sug7=100&oq=&rsv_btype=t&f=8&inputT=5752&rsv_sug4=6599&x_bfe_rqs=032000000000000000004800000000000000000000000008&x_bfe_tjscore=0.080000&tngroupname=organic_news&newVideo=12&goods_entry_switch=1&pn='+ str(num) res = requests.get(url, headers=headers).text baidu(i+1) print("第"+str(i+1)+"页爬取成功") import re p_title = '}">(.*?)
(.*?)<span ' #提取时间 info=re.findall(p_info,res,re.S) print(info) p_href= '<a class="source-link_Ft1ov" href="(.*?)"' #提取网址 href=re.findall(p_href,res,re.S) print(href) p_souce='<span class="c-color-gray" aria-label=".*?">(.*?)</span>' #提取来源 souce=re.findall(p_souce,res,re.S) print(souce) for i in range(len(title)): title[i]=re.sub('<.*?>','',title[i]) #去掉、 print(str(i+1)+"."+title[i]+' ('+info[i]+"-"+souce[i]+')') print(" ",href[i])
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/default.jpg!1)
weixin_38553275
- 粉丝: 5
- 资源: 917
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
会员权益专享
最新资源
- 保险服务门店新年工作计划PPT.pptx
- 车辆安全工作计划PPT.pptx
- ipqc工作总结PPT.pptx
- 车间员工上半年工作总结PPT.pptx
- 保险公司员工的工作总结PPT.pptx
- 报价工作总结PPT.pptx
- 冲压车间实习工作总结PPT.pptx
- ktv周工作总结PPT.pptx
- 保育院总务工作计划PPT.pptx
- xx年度现代教育技术工作总结PPT.pptx
- 出纳的年终总结PPT.pptx
- 贝贝班班级工作计划PPT.pptx
- 变电值班员技术个人工作总结PPT.pptx
- 大学生读书活动策划书PPT.pptx
- 财务出纳月工作总结PPT.pptx
- 大学生“三支一扶”服务期满工作总结(2)PPT.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)