News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

MakeBeta Blog:
Scraping Links With PHP
August 15, 2007 @ 12:08:00

From Justin Laing over at Merchant OS there's a new tutorial on creating a simple link scraper with the help of PHP and the cURL extension.

In this tutorial you will learn how to build a PHP script that scrapes links from any web page. You learn how to use cURL, call PHP DOM functions, use XPath and store the links in MySQL.

You'll have to have PHP5 and the cURL extension enabled on your web server to make it all work, but the code is all there ready for you to cut and paste. The application grabs the page with cURL (including the possibility to fake your user agent), parses through the HTML with the DOM and XPath functionality to grab the links and uses the MySQL methods to store them into your database.

2 comments voice your opinion now!
scrape link curl dom xpath mysql tutorial scrape link curl dom xpath mysql tutorial


blog comments powered by Disqus

Similar Posts

DevShed: User-defined Interfaces in PHP 5 - Turning MySQL Classes into Interface Implementers

DevShed: Creating a MySQL Abstraction Layer with Bridge Classes in PHP 5

Steven Macintyre's Blog: Building a Modular Zend Framework CMS

Evan Coury's Blog: Using Zend\Dbs TableGateway & HydratingResultSet to return rows as custom enties

Shahar Evron's Blog: Adapters of the new Zend_Http_Client


Community Events





Don't see your event here?
Let us know!


community version unittest voicesoftheelephpant interview language release conference symfony opinion introduction api framework podcast configure series threedevsandamaybe composer list laravel

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework