Home > php教程 > php手册 > PHP实现抓取迅雷VIP账号的方法

PHP实现抓取迅雷VIP账号的方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 19:50:13
Original
1353 people have browsed it

这篇文章主要介绍了PHP实现抓取迅雷VIP账号的方法,实例分析了php基于采集类Snoopy实现页面抓取及正则匹配的相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下

本文实例讲述了PHP实现抓取迅雷VIP账号的方法。分享给大家供大家参考。具体如下:

看了@Jinn_Wei Python版本的抓取账号,,于是顺手写了个PHP版本
PS1:代码没经过优化,只实现了基本的功能
PS2:代码中使用了Snoopy
PS3:测试地址:

fetchlinks($url)->getResults(); foreach($result as $key=>$val) { if(FALSE === strpos($val, 'thread-')) { unset($result[$key]); } else { if(!strpos($val, '-1-1.html')) { unset($result[$key]); } } } $real = new Snoopy(); $result = array_values(array_unique($result)); $text = $real->fetchtext($result[1])->getResults(); $text = iconv('gbk','UTF-8//IGNORE',$text); //匹配出需要的内容 $pattern = '/^迅雷会员账号|迅雷共享账号+[a-zA-Z0-9_]{4,15}+:+[0-9]+爱密码分享密码+[a-zA-Z0-9_]{4,20}\s/'; preg_match_all($pattern,$text,$return); foreach($return[0] as $a) { echo $a; echo '
'; }

Snoopy-1.2.3.tar.gz点击此处本站下载。

希望本文所述对大家的php程序设计有所帮助。

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template