{"record":{"id":"02b2d2969b313d52","repo":"unclecode/crawl4ai","slug":"k-is-deprecated-regexextractionstrategy-unwan","errorCode":null,"errorMessage":"{k} is deprecated, {RegexExtractionStrategy._UNWANTED_PROPS[k]}","messagePattern":"(.+?) is deprecated, (.+?)","errorType":"validation","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"crawl4ai/extraction_strategy.py","lineNumber":2761,"sourceCode":"    @staticmethod\n    def generate_pattern(\n        label: str,\n        html: str,\n        *,\n        query: Optional[str] = None,\n        examples: Optional[List[str]] = None,\n        llm_config: Optional[LLMConfig] = None,\n        **kwargs,\n    ) -> Dict[str, str]:\n        \"\"\"\n        Ask an LLM for a single page-specific regex and return\n            {label: pattern}   ── ready for RegexExtractionStrategy(custom=…)\n        \"\"\"\n\n        # ── guard deprecated kwargs\n        for k in RegexExtractionStrategy._UNWANTED_PROPS:\n            if k in kwargs:\n                raise AttributeError(\n                    f\"{k} is deprecated, {RegexExtractionStrategy._UNWANTED_PROPS[k]}\"\n                )\n\n        # ── default LLM config\n        if llm_config is None:\n            llm_config = create_llm_config()\n\n        # ── system prompt – hardened\n        system_msg = (\n            \"You are an expert Python-regex engineer.\\n\"\n            f\"Return **one** JSON object whose single key is exactly \\\"{label}\\\", \"\n            \"and whose value is a raw-string regex pattern that works with \"\n            \"the standard `re` module in Python.\\n\\n\"\n            \"Strict rules (obey every bullet):\\n\"\n            \"• If a *user query* is supplied, treat it as the precise semantic target and optimise the \"\n            \"  pattern to capture ONLY text that answers that query. If the query conflicts with the \"\n            \"  sample HTML, the HTML wins.\\n\"\n            \"• Tailor the pattern to the *sample HTML* – reproduce its exact punctuation, spacing, \"","sourceCodeStart":2743,"sourceCodeEnd":2779,"githubUrl":"https://github.com/unclecode/crawl4ai/blob/7e801521428ee12509994d39151006f64055ebe3/crawl4ai/extraction_strategy.py#L2743-L2779","documentation":"Error \"{k} is deprecated, {RegexExtractionStrategy._UNWANTED_PROPS[k]}\" thrown in unclecode/crawl4ai.","triggerScenarios":"Thrown at crawl4ai/extraction_strategy.py:2761 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the deprecated property and use the replacement indicated in the message.","Check the RegexExtractionStrategy documentation for the current property names."],"exampleFix":"# Replace deprecated kwarg with the supported one per the deprecation message","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7e801521428ee12509994d39151006f64055ebe3","analyzedAt":"2026-08-14T20:46:20.673Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}