Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Dec 15, 2016
1 parent 83be592 commit d80d8b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All Notable changes to `spatie/crawler` will be documented in this file.

## 2.0.5 - 2016-12-15
- fix detection of redirects

## 2.0.4 - 2016-12-15
- fix the default timeout of 5 seconds

Expand Down
10 changes: 6 additions & 4 deletions src/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ class Crawler
*/
public static function create(array $clientOptions = [])
{
$client = new Client($clientOptions);
$client = new Client($clientOptions ?? [
RequestOptions::ALLOW_REDIRECTS => false,
RequestOptions::COOKIES => true,
]);

return new static($client);
}
Expand Down Expand Up @@ -118,9 +121,8 @@ protected function startCrawlingQueue()
$pool = new Pool($this->client, $this->getCrawlRequests(), [
'concurrency' => $this->concurrency,
'options' => [
RequestOptions::CONNECT_TIMEOUT => 5,
RequestOptions::TIMEOUT => 5,

RequestOptions::CONNECT_TIMEOUT => 10,
RequestOptions::TIMEOUT => 10,
],
'fulfilled' => function (ResponseInterface $response, int $index) {
$this->handleResponse($response, $index);
Expand Down

0 comments on commit d80d8b7

Please sign in to comment.