You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9adfc8d
Browse filesBrowse the repository at this point in the historyBrowse files
stlc-bot
committed
feat(scrape): add prebuilt Google Maps parsing (#1824)
Copy file name to clipboardExpand all lines: src/context/dev/types/web_scrape_response.py
+12-6Lines changed: 12 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -266,9 +266,8 @@ class Metadata(BaseModel):
266
266
267
267
268
268
classParsed(BaseModel):
269
-
"""Fields from `parseParams.rules`, after content filters.
270
-
271
-
Unmatched fields are `null` (`[]` for lists).
269
+
"""
270
+
Custom rules return fields after content filters; unmatched fields are null ([] for lists). The google-maps parser returns business records in data.results and reads Maps data directly, independently of DOM filters and other outputs.
272
271
"""
273
272
274
273
data: Optional[Dict[str, object]] =None
@@ -278,6 +277,12 @@ class Parsed(BaseModel):
278
277
success: Optional[bool] =None
279
278
"""`true` if returned, `false` if it failed, `null` if not requested."""
280
279
280
+
type: Literal["custom", "google-maps"]
281
+
"""
282
+
The selected prebuilt parser name, or custom when type is omitted, custom rules
283
+
are used, or parsing is not requested.
284
+
"""
285
+
281
286
error_code: Optional[str] =None
282
287
"""Why the output failed. Present only when `success` is `false`."""
283
288
@@ -454,9 +459,10 @@ class WebScrapeResponse(BaseModel):
454
459
"""Page metadata. Fields are omitted when not found."""
455
460
456
461
parsed: Parsed
457
-
"""Fields from `parseParams.rules`, after content filters.
458
-
459
-
Unmatched fields are `null` (`[]` for lists).
462
+
"""
463
+
Custom rules return fields after content filters; unmatched fields are null ([]
464
+
for lists). The google-maps parser returns business records in data.results and
465
+
reads Maps data directly, independently of DOM filters and other outputs.
0 commit comments