11 Commits

Author SHA1 Message Date
James
432acb7475 add setUserAgent support
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2020-11-16 12:58:28 +00:00
James
6b28eb168e revert fix redirectloop test
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2020-11-15 18:34:28 +00:00
James
4e29ca154e downgrade
Some checks failed
continuous-integration/drone/push Build is failing
2020-11-15 18:33:05 +00:00
James
fbf6d31c5b update package version
Some checks failed
continuous-integration/drone/push Build is failing
2020-11-15 18:29:48 +00:00
James
a4037f2d95 fix package version
Some checks failed
continuous-integration/drone/push Build is failing
2020-11-15 18:28:20 +00:00
James
437d0fbf4e fix redirect loop test
Some checks failed
continuous-integration/drone/push Build is failing
2020-11-15 14:54:32 +00:00
James
418747027b try older spate crawler
Some checks failed
continuous-integration/drone/push Build is failing
2020-11-15 14:49:47 +00:00
James
7b9b125f57 crawl externals too
Some checks failed
continuous-integration/drone/push Build is failing
2020-11-15 14:43:23 +00:00
James
e2fe2eedf7 fix
Some checks failed
continuous-integration/drone/push Build is failing
2020-11-15 14:33:08 +00:00
James
f46074dfba better phpunit output 2020-11-15 14:31:42 +00:00
James
44d07858b5 update
Some checks failed
continuous-integration/drone/push Build is failing
2020-11-15 14:27:14 +00:00
4 changed files with 485 additions and 230 deletions

View File

@@ -22,7 +22,7 @@ steps:
- name: run tests
image: chialab/php
commands:
- URL=http://testserver:8080 vendor/bin/phpunit tests
- URL=http://testserver:8080 vendor/bin/phpunit tests --testdox --color=always --no-interaction
services:

View File

@@ -4,8 +4,9 @@
"type": "library",
"require": {
"php": "^7.1",
"spatie/crawler": "^4.6",
"cweagans/composer-patches": "~1.0"
"spatie/crawler": "4.6.6",
"cweagans/composer-patches": "~1.0",
"guzzlehttp/guzzle": "6.5.2"
},
"require-dev": {
"phpunit/phpunit": "^8.5"
@@ -27,7 +28,7 @@
"add crawled again observer": "https://patch-diff.githubusercontent.com/raw/spatie/crawler/pull/280.patch"
},
"guzzlehttp/guzzle": {
"Status code must be an integer value between 1xx and 5xx": "https://patch-diff.githubusercontent.com/raw/guzzle/guzzle/pull/2591.patch"
"Status code must be an integer value between 1xx and 5xx": "https://github.com/guzzle/guzzle/commit/f81cd6cdff1213f90de8f012489017510e3d6ff4.patch"
}
}
}

699
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@ use Psr\Http\Message\UriInterface;
use Spatie\Crawler\Crawler as SpatieCrawler;
use Spatie\Crawler\CrawlUrl;
use Spatie\Crawler\CrawlInternalUrls;
use Spatie\Crawler\CrawlAllUrls;
class Crawler{
@@ -25,6 +25,11 @@ class Crawler{
$this->observer = new CrawlObserver();
$this->crawler->setCrawlObserver($this->observer);
$this->crawler->setCrawlProfile(new CrawlAllUrls());
}
public function setUserAgent($agent){
$this->crawler->setUserAgent($agent);
}
public function crawl($url){