« SoloSEO, Everything you need for SEO | Main | Confidential SEO Secrets Book Now Free »

Scraping Links With PHP

Justin Laing have written a good tutorial on scraping links from any website using PHP. Very useful if you look forward making a link analyzer tool. The tutorial uses CURL and DOMXPath to retrieve data and extract links. However you can also use it to retrieve more informations about the same link such the "alt" and "target" attributes.

$url = $href->getAttribute('href');
$alt = $href->getAttribute('alt');
$target = $href->getAttribute('target');

Then you can change your tables accordingly to store these new informations.

Bookmark this article at these sites
Post a comment





(Email will remain hidden)





Please enter the security code you see here




Related entries
Email to a friend
Email this article to:


Your email address:


Message (optional):