When it comes to acquisition, it's nothing more than a remote access to information------Read more
It's an enhanced version of the Simple Thief program.
Here is the corresponding core code (don't do bad things oh ^_^)
The content to be collected is an announcement on a game website, such as:
Basic page information can be obtained first using file_get_contents and simple regularization
Organize the basic information, collect the storage:
<?php include_once ("conn.php"); if ($_get[' id ']<=8&&$_get[' id ') { $id =$_get[' id ']; $conn =file_get_contents ("http://www.93moli.com/news_list_4_$id.html");//Get page content $pattern = "/
/ius ";//Regular Preg_match_all ($pattern, $conn, $arr);//match content to arr array //print_r ($arr);d ie; The foreach ($arr [1] as $key + $value) {//two-D array [2] corresponds to the same ID as [1], utilizing the key $url = "http://www.93moli.com/". $arr [2][$key] ; $sql = "INSERT into List (Title,url) value (' $value ', ' $url ')"; mysql_query ($sql); echo "$value". "
"; } $id + +; echo "Collecting URL data list $id ... Please later ... "; echo "";} else{ echo "Collect Data end. "; }? >
conn.php is a database connection file
list.php is this page
Because the data to be collected is paginated, and the page address is a regular increment, so I used the JS jump code, the use of ID value to control the number of pages collected, but also to avoid too large for a loop.
Easy Data Warehousing, the next article to write about the specific URL to collect information process.