unclecode/crawl4ai · error · AttributeError
{self.__class__.__name__} object has no attribute '{attr}'
Error message
{self.__class__.__name__} object has no attribute '{attr}' What it means
Error "{self.__class__.__name__} object has no attribute '{attr}'" thrown in unclecode/crawl4ai.
Source
Thrown at crawl4ai/models.py:315
def __iter__(self):
return iter(self._results)
async def __aiter__(self):
for item in self._results:
yield item
def __getitem__(self, index):
return self._results[index]
def __len__(self):
return len(self._results)
def __getattr__(self, attr):
# Delegate attribute access to the first element.
if self._results:
return getattr(self._results[0], attr)
raise AttributeError(f"{self.__class__.__name__} object has no attribute '{attr}'")
def __repr__(self):
return f"{self.__class__.__name__}({self._results!r})"
RunManyReturn = Union[
CrawlResultContainer[CrawlResultT],
AsyncGenerator[CrawlResultT, None]
]
# END of backward compatibility code for markdown/markdown_v2.
# When removing this code in the future, make sure to:
# 1. Replace the private attribute and property with a standard field
# 2. Update any serialization logic that might depend on the current behavior
class AsyncCrawlResponse(BaseModel):
html: str
response_headers: Dict[str, str]View on GitHub (pinned to 7e80152142)
Solutions
- Check the attribute name for typos against the model's defined fields.
- Upgrade code that references removed/renamed attributes to the current model API.
Example fix
getattr(result, 'markdown') # use a valid attribute
When it happens
Trigger: Thrown at crawl4ai/models.py:315 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/7753f03187727178.
Report an issue: GitHub.