.. _framework-rules: ================ Supporting rules ================ Ideally, a framework should support returning the right :ref:`page object ` or :ref:`output item ` given a target URL and a desired :ref:`output item class ` when :ref:`rules ` are used. To provide basic support for rules in your framework, use the :class:`~.RulesRegistry` object at ``web_poet.default_registry`` to choose a page object based on rules: .. code-block:: python from web_poet import default_registry page_cls = default_registry.page_cls_for_item("https://example.com", MyItem) You should also let your users know what is the best approach to :ref:`load rules ` when using your framework. For example, let them know the best location for their calls to the :func:`~.web_poet.rules.consume_modules` function.