Setup

Install

pip install scrapy-poet

Enable

Add the following to your Scrapy configuration to enable scrapy-poet:

Configure

Declare the 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:

settings.py
SCRAPY_POET_DISCOVER = ["myproject.pages"]