dimgraycat / pickurl
A simple PHP Web Url Pick.
Installs: 26
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:application
Requires
- php: >=5.5.0
- fabpot/goutte: 3.1.0
- sabre/uri: 1.0.1
This package is auto-updated.
Last update: 2024-12-24 16:27:50 UTC
README
Requirements
PHP-PickUrl depends on PHP 5.5+ and Goutte 1+ and Guzzle 6+.
Installation
This library can be found on Packagist. The recommended way to install this is through composer.
Edit your composer.json
and add:
{ "require": { "dimgraycat/pickurl": "*" } }
And install dependencies:
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
Usage
Create a Pickurl\Spider Client instance:
<?php $spider = new PickUrl\Spider(); $spider->addHook('before', function($crawler, $crawl_url) { print "$crawl_url\n"; }) ->addHook('after', function($crawler, $crawl_url, $searched_urls) { print_r($searched_urls); }) ->crawl('http://foo.sample.com');
set UserAgent:
$this->setUserAgent("MyCrawler 1.0");
set WaitTime:
// default is 10sec. It can be shortened by setting. $this->WaitTime(1);