{"record":{"id":"611d7d7885d66307","repo":"D4Vinci/Scrapling","slug":"unknown-parser-argument-key-maybe-you-meant","errorCode":null,"errorMessage":"Unknown parser argument: \"{key}\"; maybe you meant {cls.parser_keywords}?","messagePattern":"Unknown parser argument: \"(.+?)\"; maybe you meant (.+?)\\?","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"scrapling/engines/toolbelt/custom.py","lineNumber":206,"sourceCode":"            storage=cls.storage,\n            storage_args=cls.storage_args,\n            adaptive_domain=cls.adaptive_domain,\n        )\n\n    @classmethod\n    def configure(cls, **kwargs):\n        \"\"\"Set multiple arguments for the parser at once globally\n\n        :param kwargs: The keywords can be any arguments of the following: huge_tree, keep_comments, keep_cdata, adaptive, storage, storage_args, adaptive_domain\n        \"\"\"\n        for key, value in kwargs.items():\n            key = key.strip().lower()\n            if hasattr(cls, key):\n                if key in cls.parser_keywords:\n                    setattr(cls, key, value)\n                else:\n                    # Yup, no fun allowed LOL\n                    raise AttributeError(f'Unknown parser argument: \"{key}\"; maybe you meant {cls.parser_keywords}?')\n            else:\n                raise ValueError(f'Unknown parser argument: \"{key}\"; maybe you meant {cls.parser_keywords}?')\n\n        if not kwargs:\n            raise AttributeError(f\"You must pass a keyword to configure, current keywords: {cls.parser_keywords}?\")\n\n    @classmethod\n    def _generate_parser_arguments(cls) -> Dict:\n        # Selector class parameters\n        # I won't validate Selector's class parameters here again, I will leave it to be validated later\n        parser_arguments = dict(\n            huge_tree=cls.huge_tree,\n            keep_comments=cls.keep_comments,\n            keep_cdata=cls.keep_cdata,\n            adaptive=cls.adaptive,\n            storage=cls.storage,\n            storage_args=cls.storage_args,\n            adaptive_domain=cls.adaptive_domain,","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/D4Vinci/Scrapling/blob/5d213a2d4764002bfc4fed33c32fe09fa8b0bf7f/scrapling/engines/toolbelt/custom.py#L188-L224","documentation":"Raised by BaseFetcher.configure() when a keyword names an attribute that exists on the class but is not one of the tunable parser keywords. hasattr(cls, key) is true (the name collides with a class member like 'configure', 'display_config', or any future class attribute), but since key not in parser_keywords it refuses to setattr — hence AttributeError with the 'maybe you meant' hint listing valid keywords.","triggerScenarios":"Calling Fetcher.configure(configure=True), .configure(display_config=...), or passing any class-attribute name that isn't in parser_keywords (huge_tree, keep_comments, keep_cdata, adaptive, storage, storage_args, adaptive_domain).","commonSituations":"Trying to set fetching options (proxy, stealth, timeout) through configure() instead of the fetcher constructor; guessing an option name that happens to match a method on the class.","solutions":["Use only the seven parser keywords listed in the error: huge_tree, keep_comments, keep_cdata, adaptive, storage, storage_args, adaptive_domain.","Set request-level options on the fetcher instance/session (e.g., Fetcher(proxy=..., stealth=True)), not via configure().","Check the hint in the message — it prints the accepted tuple."],"exampleFix":"# before\nFetcher.configure(configure=True, adaptive=True)  # AttributeError\n\n# after\nFetcher.configure(adaptive=True, huge_tree=False)","handlingStrategy":"validation","validationCode":"from scrapling.engines.toolbelt.custom import BaseFetcher\n\ndef safe_configure(**kwargs):\n    bad = [k for k in kwargs if k not in BaseFetcher.parser_keywords]\n    if bad:\n        raise ValueError(f'Invalid parser options {bad}; allowed: {BaseFetcher.parser_keywords}')\n    BaseFetcher.configure(**kwargs)","typeGuard":"def is_parser_keyword(key: str) -> bool:\n    from scrapling.engines.toolbelt.custom import BaseFetcher\n    return key.strip().lower() in BaseFetcher.parser_keywords","tryCatchPattern":"try:\n    Fetcher.configure(**options)\nexcept (AttributeError, ValueError) as e:\n    if 'Unknown parser argument' in str(e):\n        logger.error('bad configure keys: %s', list(options))\n    raise","preventionTips":["Validate keys against BaseFetcher.parser_keywords before calling configure().","Keep request-level options on the fetcher constructor, not configure().","Never pass method names (configure, display_config) as options."],"tags":["configuration","parser","validation","fetcher"],"backgroundTag":null,"analyzedSha":"5d213a2d4764002bfc4fed33c32fe09fa8b0bf7f","analyzedAt":"2026-08-14T22:23:09.440Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}