diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a2232d11..15bf84ff 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog ========= +0.26.0 (2025-01-DD) +------------------- + +* Added an :ref:`add-on `. + 0.25.0 (2024-12-27) ------------------- diff --git a/docs/intro/setup.rst b/docs/intro/setup.rst index 24c3aece..84309c07 100644 --- a/docs/intro/setup.rst +++ b/docs/intro/setup.rst @@ -6,13 +6,22 @@ Setup .. _intro-install: -Install from PyPI:: +Install +======= + +.. code-block:: bash pip install scrapy-poet -Then configure: -- For Scrapy ≥ 2.10, install the add-on: +Enable +====== + +Add the following to your Scrapy configuration to enable scrapy-poet: + +.. _addon: + +- For Scrapy ≥ 2.10, configure the add-on: .. code-block:: python :caption: settings.py @@ -54,3 +63,19 @@ Then configure: SPIDER_MIDDLEWARES = { "scrapy_poet.RetryMiddleware": 275, } + + +Configure +========= + +Declare the :setting:`SCRAPY_POET_DISCOVER` setting with a list of modules that +define page objects, so that they can be loaded at run-time. + +A best practice is to create a ``pages/`` folder in your Scrapy project, a +sibling of your ``spiders/`` folder, add an empty ``__init__.py`` file to it +to make it a Python module, and declare its import path in the setting: + +.. code-block:: python + :caption: settings.py + + SCRAPY_POET_DISCOVER = ["myproject.pages"]