Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
199 additions
and
23 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Migration | ||
========= | ||
|
||
.. contents:: Table of Contents | ||
:depth: 2 | ||
:local: | ||
|
||
From 1.5 to 1.6 | ||
--------------- | ||
|
||
**Headers have default values and are case insensitive** | ||
|
||
From now on the headers identity option has default values and is a case insensitive dict. When changing headers the ``.update()`` method should be used so the default headers remain. | ||
|
||
.. code:: python | ||
# Old | ||
options.identity.headers = { | ||
"User-Agent": "MyCustomUserAgent" | ||
} | ||
# New | ||
options.identity.headers.update({ | ||
"User-Agent": "MyCustomUserAgent" | ||
}) | ||
**New default user agent** | ||
|
||
The default user agent for the crawler has changed. In version 1.5 it was a fake Chrome user agent and from now on it is ``nyawc/1.6.0 CPython/3.6.1 Windows/10`` based on the versions you use. | ||
|
||
The Chrome user agent from version 1.5 can still be faked by using the code below. | ||
|
||
.. code:: python | ||
options.identity.headers.update({ | ||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36" | ||
}) | ||
From 1.4 to 1.5 | ||
--------------- | ||
|
||
**Renamed the domain must match scope option** | ||
|
||
Since version 1.5 the domain_must_match option is now called hostname_must_match. | ||
|
||
.. code:: python | ||
# Old | ||
Options().scope.domain_must_match = True/False | ||
# New | ||
Options().scope.hostname_must_match = True/False |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Misc | ||
==== | ||
|
||
.. contents:: Table of Contents | ||
:depth: 2 | ||
:local: | ||
|
||
How to use misc options | ||
------------------------------ | ||
|
||
.. code:: python | ||
# misc_example.py | ||
from nyawc.Options import Options | ||
from nyawc.Crawler import Crawler | ||
from nyawc.http.Request import Request | ||
options = Options() | ||
options.misc.debug = False | ||
crawler = Crawler(options) | ||
crawler.start_with(Request("https://finnwea.com/")) | ||
Available misc options | ||
---------------------- | ||
|
||
**Debug** | ||
|
||
If debug is enabled extra information will be logged to the console. Default is False. | ||
|
||
``options.misc.debug = True`` |
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