News Feed
Sections




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

SitePoint PHP Blog:
Image Scraping with Symfony's DomCrawler
March 31, 2014 @ 09:06:43

On the SitePoint PHP blog today there's a new post showing you how to use the Symfony DomCrawler component to scrape content, images mostly, from a remote website. The DomCrawler is one component of the Symfony framework.

A photographer friend of mine implored me to find and download images of picture frames from the internet. I eventually landed on a web page that had a number of them available for free but there was a problem: a link to download all the images together wasn't present. I didn't want to go through the stress of downloading the images individually, so I wrote this PHP class to find, download and zip all images found on the website.

He talks briefly about how the class works and then gets into the contents of the class. He walks through all the code and explains in chunks what each part does in the lifecycle of the request. The end result is a Zip archive file of all images from the remote website, packaged up for easy transport.

0 comments voice your opinion now!
domcrawler symfony framework component tutorial image scrape

Link: http://www.sitepoint.com/image-scraping-symfonys-domcrawler/

blog comments powered by Disqus

Similar Posts

Paul Jones: How Is Aura Better Than (er, Different From ;-) Than Symfony and Zend?

WebReferece.com: Managing Your Email Campaigns with phpList

SitePoint PHP Blog: Keeping Your PHP Code Well Documented

PHPMaster.com: Under the Hood of Yii’s Component Architecture, Part 2

Ray Cheung's Blog: Comparison Between Zend and CakePHP Framework


Community Events

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


release library version community example application interview php7 composer api framework laravel series symfony2 opinion performance extension introduction voicesoftheelephpant podcast

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