blanchonvincent / simple-page-crawler
ZF2 module v0.3.0 - Provide a crawler to get web page informations : title, meta, heading tags and images
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 191
Dependents: 0
Suggesters: 0
Security: 0
Stars: 12
Watchers: 2
Forks: 8
Open Issues: 1
Type:module
Requires
- php: >=5.3.3
- zendframework/zendframework: 2.*
This package is not auto-updated.
Last update: 2019-04-29 00:41:49 UTC
README
Version 0.3.0 Created by Vincent Blanchon
Introduction
SimplePageCrawler is a web page crawler. You can get informations :
- Title
- Meta (decsription, open graph, 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'));
Advanced usage
You can get Open graph metadatas :
$page = $this->simplePageCrawler('http://www.nytimes.com'); $metas = $page->getMeta()->getOpenGraph();