Posted by Shuan on 08/17/06 21:35
I am trying to grab sites like craigslist, parse with regular expression
and put some content into database.
$request -> fetch( $region_link );
if( !$request -> error ){
$pageContent = $request -> results;
$regionpattern =
"/<a[^>]*href=\"(\/s\/SL\/sg_maY.*)\".*>.*<img.*alt=\"(.*)\".*id=\"btn.*\">/
siU";
if(preg_match_all( $regionpattern, $pageContent, $categorylinks ))
{
for( $y = 0; $y < count( $categorylinks[ 1 ] ); $y++ ){
$category_link="http://www.mysite.com".$categorylinks[ 1 ][ $y ];
include( "pagecrawler.php" );
}
}
[Back to original message]
|