Scraping Links With PHP
By Justin Laing2008-01-06
Scraping Links With PHP
In this tutorial you will learn how to build a PHP script that scrapes links from any web page.
What You’ll Learn
- How to use cURL to get the content from a website (URL).
- Call PHP DOM functions to parse the HTML so you can extract links.
- Use XPath to grab links from specific parts of a page.
- Store the scraped links in a MySQL database.
- Put it all together into a link scraper.
- What else you could use a scraper for.
- Legal issues associated with scraping content.
What You Will Need
- Basic knowledge of PHP and MySQL.
- A web server running PHP 5.
- The cURL extension for PHP.
- MySQL - if you want to store the links.
Tutorial pages:
|
Originally posted on Makebeta
|
|||||||||
You might also want to check these out:
|
Leave a Comment on "Scraping Links With PHP"
You must be logged in to post a comment.
Link to This Tutorial Page!

