CrawlResults · Python
Python collection of per-page extraction results.
In this guide
Purpose and lifecycle
This is a return type, not a top-level package export. It retains results in memory. Current Crawl.build wraps native dictionaries as DatasetResult handles, so conversion/export through that path needs correction.
pandas is required for df(); Parquet export through pandas needs an installed Parquet engine.
Definition and availability
Source snapshot: 1.0.0-alpha.3. Reachable result/callback type; not a top-level package export. Declared in source; this is not a runtime test result.
Signatures and source locations are generated from the SDK wrappers. Clean snapshots link to the recorded commit. Modified snapshots link to main, which may differ; file hashes identify the local inputs.
class CrawlResultsMembers
| Member | Kind | Return / value type | Source status |
|---|---|---|---|
| __init__ | method | Not annotated; see behavior notes | Present in source |
| to_json | method | Not annotated; see behavior notes | Present in source |
| to_csv | method | Not annotated; see behavior notes | Present in source |
| to_parquet | method | Not annotated; see behavior notes | Present in source |
| df | method | Not annotated; see behavior notes | Present in source |
| __iter__ | method | iter | Present in source |
| __len__ | method | int | Present in source |
| __getitem__ | method | DatasetResult | Present in source |
| __repr__ | method | str | Present in source |
__init__()
Store an in-memory list of DatasetResult wrappers. No fetching or exporting happens during construction.
Returns / value: Not annotated; see behavior notes.
def __init__(self, results: List[DatasetResult])| Parameter | Type | Required / default | Meaning |
|---|---|---|---|
| results | List[DatasetResult] | Required | List of DatasetResult wrappers retained in memory. |
to_json()
Write a JSON array of all field dictionaries.
Returns / value: Not annotated; see behavior notes.
def to_json(self, path: str)| Parameter | Type | Required / default | Meaning |
|---|---|---|---|
| path | str | Required | Filesystem path relative to the process working directory unless absolute. |
to_csv()
Write all field maps using the first result’s keys as columns; inconsistent later keys can fail.
Returns / value: Not annotated; see behavior notes.
def to_csv(self, path: str)| Parameter | Type | Required / default | Meaning |
|---|---|---|---|
| path | str | Required | Filesystem path relative to the process working directory unless absolute. |
to_parquet()
Build a pandas DataFrame and export it with the installed Parquet engine.
Returns / value: Not annotated; see behavior notes.
def to_parquet(self, path: str)| Parameter | Type | Required / default | Meaning |
|---|---|---|---|
| path | str | Required | Filesystem path relative to the process working directory unless absolute. |
df()
Collect every field dictionary into a pandas DataFrame.
Returns / value: Not annotated; see behavior notes.
def df(self)__iter__()
Iterate over the stored DatasetResult wrappers. See any known limitation above before using a materialized Python collection.
Returns / value: iter.
def __iter__(self) -> iter__len__()
Return the number of stored results or matched elements; no additional pages are fetched.
Returns / value: int.
def __len__(self) -> int__getitem__()
Index the backing Python list of results. List indexing rules apply, including negative indices and IndexError outside the list.
Returns / value: DatasetResult.
def __getitem__(self, idx) -> DatasetResult| Parameter | Type | Required / default | Meaning |
|---|---|---|---|
| idx | Not annotated | Required | Python list index for CrawlResults; negative indices follow list semantics. |
__repr__()
Return a short debugging representation of the wrapper. This is not a data export or a stable serialization format.
Returns / value: str.
def __repr__(self) -> strErrors and operational limits
Filesystem, pandas dependency and native result-shape errors may propagate.
Source availability, package publication and runtime validation are separate facts. These pages describe the source snapshot, not a claim that all platforms or every API path have passed production acceptance.