ScrapiumBrowser
Experimental ScrapflyScrapfly browser extensions for file downloads. These commands are handled by the Scrapfly browser proxy and are available in all Cloud Browser sessions.
No symbols match your filter.
Commands
ScrapiumBrowser.getDownloads
Experimental Scrapfly Returns all downloaded files as a map of filename to base64-encoded content.
Files are read from the browser's download directory.
Parameters
| Name | Type | Description |
|---|---|---|
delete
(optional) |
boolean |
Delete files from disk after reading them. Default false. |
Return Object
| Name | Type | Description |
|---|---|---|
files
|
object |
Map of filename to base64-encoded file content. |
ScrapiumBrowser.getDownload
Experimental Scrapfly Returns a single downloaded file by name as base64-encoded content.
Parameters
| Name | Type | Description |
|---|---|---|
filename
|
string |
Name of the file to retrieve. |
Return Object
| Name | Type | Description |
|---|---|---|
data
|
string |
Base64-encoded file content. |
ScrapiumBrowser.getDownloadsMetadatas
Experimental Scrapfly Returns metadata (file sizes) for all downloaded files without reading their content.
Return Object
| Name | Type | Description |
|---|---|---|
metadata
|
object |
Map of filename to file size in bytes. |
ScrapiumBrowser.getDownloadMetadatas
Experimental Scrapfly Returns metadata (file size) for a single downloaded file.
Parameters
| Name | Type | Description |
|---|---|---|
filename
|
string |
Name of the file to inspect. |
Return Object
| Name | Type | Description |
|---|---|---|
metadata
|
object |
Map of filename to file size in bytes. |
ScrapiumBrowser.hasDownloads
Experimental Scrapfly Returns whether any files have been downloaded in this session.
Return Object
| Name | Type | Description |
|---|---|---|
result
|
boolean |
True if at least one file has been downloaded. |
Events
ScrapiumBrowser.downloadBegin
Experimental Scrapfly Fired when a download starts.
Parameters
| Name | Type | Description |
|---|---|---|
guid
|
string |
Unique download identifier. |
url
|
string |
URL being downloaded. |
suggestedFilename
|
string |
Suggested filename for the download. |
ScrapiumBrowser.downloadProgress
Experimental Scrapfly Fired when download makes progress. Last call has state "completed".
Parameters
| Name | Type | Description |
|---|---|---|
guid
|
string |
Unique download identifier. |
receivedBytes
|
number |
Bytes received so far. |
totalBytes
|
number |
Total expected bytes. |
state
|
string |
Download state: inProgress, completed, canceled. |
ScrapiumBrowser.downloadComplete
Experimental Scrapfly Fired when a download completes successfully.
Parameters
| Name | Type | Description |
|---|---|---|
guid
|
string |
Unique download identifier. |
ScrapiumBrowser.downloadCanceled
Experimental Scrapfly Fired when a download is canceled.
Parameters
| Name | Type | Description |
|---|---|---|
guid
|
string |
Unique download identifier. |
ScrapiumBrowser.downloadFailed
Experimental Scrapfly Fired when a download fails.
Parameters
| Name | Type | Description |
|---|---|---|
guid
|
string |
Unique download identifier. |
error
|
string |
Error description. |