Jump to content

Crawl page for any link


android2

Recommended Posts

Hello everyone, I'm matt.

 

OK, I am trying to build a crawler that will get links and this code does get links from simple html page:

<?php
$URL = 'http://google.com/search?q=gold';

preg_match_all("/<a href=['\"](.*?)['\"][ ]?/i",file_get_contents($URL),$matches);

print_r($matches[1]);
?>

 

But I need a way to get ALL/ANY link on a page. Including links generated from feeds, widgets, etc. All links that a user sees. How can I do this? Please, any help would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/87173-crawl-page-for-any-link/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.