This article mainly introduces how to capture thunder VIP accounts in PHP. The example analyzes the skills related to page capturing and regular expression matching in php Based on Snoopy of the Collection class, which has some reference value, for more information, see
This article mainly introduces how to capture thunder VIP accounts in PHP. The example analyzes the skills related to page capturing and regular expression matching in php Based on Snoopy of the Collection class, which has some reference value, for more information, see
This example describes how to capture the thunder VIP account in PHP. Share it with you for your reference. The details are as follows:
I read the account captured by @ Jinn_Wei Python, so I wrote a PHP version.
PS1: the code is not optimized and only basic functions are implemented.
PS2: Snoopy is used in the code.
PS3: Test address:
<? Php/*** capture the love password thunder VIP account * @ author kphcdr@163.com */header ("Content-type: text/html; charset = UTF-8"); include 'snoopy. php '; $ url = 'HTTP: // response = new Snoopy (); $ result = $ snoopy-> 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 ); // match the required content $ pattern = '/^ thunder member account | thunder sharing account + [a-zA-Z0-9 _] {} +: + [0-9] + password sharing + [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 click here download site.
I hope this article will help you with php programming.