Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

mail crowler

$
0
0
Hi, i tray to made a little crowler, that have to take all email addres in one website.

have found method for look at all page of site, but probably script have some problem because return a blank arrays

ther is code.

for ($i=0; $i<4000; $i++){
		$url = "http://www.viacriatusurbis.org/?page_id=188&ID=$i";	
	
		$page = file_get_contents($url);
		
		$start = '<td class="TabellaDatiCella">';
		$end = '</td>';
		$data = substr($page, $start, $end);
		
		$pattern = '<a id="TabellaDatiParrocchieRigaEmailCellalink" href="mailto:([\w\-\.]+)@((\[([0-9]{1,3}\.){3}[0-9]{1,3}\])|(([\w\-]+\.)+)([a-zA-Z]{2,4}))">';
		preg_match_all($pattern, $data, $matches);
				
		echo "<pre>";
		var_dump($matches);
		echo "</pre>";
		
		/*for ($x=$inizio;$x<=$fine;$x++) {
    		$results[ ] = array('valore passato tra i tag del link' => 'link.');
		}*/
	}

i need to take che value of href with email adddress and put in associative arrays that have for key the value of html tag that contain email link.
someone can help? thanks

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>