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
Copy file name to clipboardExpand all lines: README.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -326,8 +326,12 @@ Parameters - object which includes:
326
326
327
327
Should return resolved `Promise` if resource should be saved or rejected with Error `Promise` if it should be skipped.
328
328
Promise should be resolved with:
329
-
*`string` which contains response body
330
-
* or object with properties `body` (response body, string) and `metadata` - everything you want to save for this resource (like headers, original text, timestamps, etc.), scraper will not use this field at all, it is only for result.
329
+
* the `response` object with the `body` modified in place as necessary.
330
+
* or object with properties
331
+
*`body` (response body, string)
332
+
*`encoding` (`binary` or `utf8`) used to save the file, binary used by default.
333
+
*`metadata` (object) - everything you want to save for this resource (like headers, original text, timestamps, etc.), scraper will not use this field at all, it is only for result.
334
+
* a binary `string`. This is advised against because of the binary assumption being made can foul up saving of `utf8` responses to the filesystem.
331
335
332
336
If multiple actions `afterResponse` added - scraper will use result from last one.
0 commit comments