unclecode/crawl4ai · error · AttributeError

is deprecated

Error message

{k} is deprecated, {RegexExtractionStrategy._UNWANTED_PROPS[k]}

What it means

Error "{k} is deprecated, {RegexExtractionStrategy._UNWANTED_PROPS[k]}" thrown in unclecode/crawl4ai.

Solutions

  1. Remove the deprecated property and use the replacement indicated in the message.
  2. Check the RegexExtractionStrategy documentation for the current property names.

Example fix

# Replace deprecated kwarg with the supported one per the deprecation message

When it happens

Trigger: Thrown at crawl4ai/extraction_strategy.py:2761 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of unclecode/crawl4ai@7e80152142 (2026-08-14). Data as JSON: /api/errors/02b2d2969b313d52. Report an issue: GitHub.

Appendix: source

Thrown at crawl4ai/extraction_strategy.py:2761

    @staticmethod
    def generate_pattern(
        label: str,
        html: str,
        *,
        query: Optional[str] = None,
        examples: Optional[List[str]] = None,
        llm_config: Optional[LLMConfig] = None,
        **kwargs,
    ) -> Dict[str, str]:
        """
        Ask an LLM for a single page-specific regex and return
            {label: pattern}   ── ready for RegexExtractionStrategy(custom=…)
        """

        # ── guard deprecated kwargs
        for k in RegexExtractionStrategy._UNWANTED_PROPS:
            if k in kwargs:
                raise AttributeError(
                    f"{k} is deprecated, {RegexExtractionStrategy._UNWANTED_PROPS[k]}"
                )

        # ── default LLM config
        if llm_config is None:
            llm_config = create_llm_config()

        # ── system prompt – hardened
        system_msg = (
            "You are an expert Python-regex engineer.\n"
            f"Return **one** JSON object whose single key is exactly \"{label}\", "
            "and whose value is a raw-string regex pattern that works with "
            "the standard `re` module in Python.\n\n"
            "Strict rules (obey every bullet):\n"
            "• If a *user query* is supplied, treat it as the precise semantic target and optimise the "
            "  pattern to capture ONLY text that answers that query. If the query conflicts with the "
            "  sample HTML, the HTML wins.\n"
            "• Tailor the pattern to the *sample HTML* – reproduce its exact punctuation, spacing, "

View on GitHub (pinned to 7e80152142)