Build Your Own Image Scraper with PHP

There are various ways to scrape information from other websites, including JSON and RSS. However, it's also possible to build a scraper using PHP.

With regular expressions you can extract portions of content such as images, text and metadata.

Why would you do this? In one example, I build a WordPress site that automatically generate new posts every day by crawling the content of my Facebook page. 

In this post, I'll share with you the code to extract images from a URL by using the file_get_contents() and preg_match_all() functions.



[[ This is a content summary only. Visit http://OSTraining.com for full links, other content, and more! ]]
 •  0 comments  •  flag
Share on Twitter
Published on January 14, 2016 19:27
No comments have been added yet.