Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 840 Bytes

README.md

File metadata and controls

38 lines (27 loc) · 840 Bytes

ZF2 SimplePageCrawler module

Version 0.2 Created by Vincent Blanchon

Introduction

SimplePageCrawler is a web page crawler. You can get informations :

  • Title
  • Meta (decsription, etc.)
  • H1, H2, etc.
  • List of the images
  • List of the links

Usage

Get page informations :

$crawler = $this->getServiceLocator('SimplePageCrawler');
$page = $crawler->get('http://www.nytimes.com');

echo sprintf('The title is "%s"', $page->getTitle());
echo sprintf('The description is "%s"', $page->getMeta('description'));

You can use th action helper :

$page = $this->simplePageCrawler('http://www.nytimes.com');

echo sprintf('The title is "%s"', $page->getTitle());
echo sprintf('The description is "%s"', $page->getMeta('description'));