-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to fetch unsuccessful requests more then once. The amount
of attempts is controlled by the max retries setting.
- Loading branch information
1 parent
3186fad
commit 6d0f911
Showing
12 changed files
with
386 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,34 @@ | ||
use Mix.Config | ||
|
||
config :crawly, | ||
manager_operations_timeout: 30_000, | ||
manager_operations_timeout: 30_000, | ||
# User agents which are going to be used with requests | ||
user_agents: [ | ||
"Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0", | ||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36", | ||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 OPR/38.0.2220.41" | ||
], | ||
# Stop spider after scraping certain amount of items | ||
closespider_itemcount: 100, | ||
# Stop spider if it does crawl fast enough | ||
closespider_timeout: 20, | ||
concurrent_requests_per_domain: 5, | ||
follow_redirects: true, | ||
# Request middlewares | ||
middlewares: [ | ||
Crawly.Middlewares.DomainFilter, | ||
Crawly.Middlewares.UniqueRequest, | ||
Crawly.Middlewares.RobotsTxt, | ||
Crawly.Middlewares.UserAgent | ||
], | ||
pipelines: [ | ||
Crawly.Pipelines.Validate, | ||
Crawly.Pipelines.DuplicatesFilter, | ||
Crawly.Pipelines.JSONEncoder | ||
], | ||
retry: [ | ||
retry_codes: [500, 404], | ||
max_retries: 2, | ||
ignored_middlewares: [Crawly.Middlewares.UniqueRequest] | ||
] | ||
|
||
# The path where items are stored | ||
base_store_path: "/tmp/", | ||
# User agents which are going to be used with requests | ||
user_agents: [ | ||
"Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0", | ||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36", | ||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 OPR/38.0.2220.41" | ||
], | ||
# Item definition | ||
item: [:title, :author, :time, :url], | ||
# Identifier which is used to filter out duplicates | ||
item_id: :title, | ||
# Stop spider after scraping certain amount of items | ||
closespider_itemcount: 100, | ||
# Stop spider if it does crawl fast enough | ||
closespider_timeout: 20, | ||
concurrent_requests_per_domain: 5, | ||
follow_redirects: true, | ||
# Request middlewares | ||
middlewares: [ | ||
Crawly.Middlewares.DomainFilter, | ||
Crawly.Middlewares.UniqueRequest, | ||
Crawly.Middlewares.RobotsTxt, | ||
Crawly.Middlewares.UserAgent | ||
], | ||
pipelines: [ | ||
Crawly.Pipelines.Validate, | ||
Crawly.Pipelines.DuplicatesFilter, | ||
Crawly.Pipelines.JSONEncoder | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.