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
Makes request to `url` and saves all files found with `srcToLoad` to `directory`.
36
+
Makes request to `url` and saves all files found with `sources` to `directory`.
37
37
38
38
**options** - object containing next options:
39
39
40
-
-`url:`url to load *(required)*
40
+
-`urls:`array of urls to load and filenames for them *(required, see example below)*
41
41
-`directory:` path to save loaded files *(required)*
42
-
-`paths:` array of objects, contains urls or relative paths to load and filenames for them (if is not set only `url` will be loaded) *(optional, see example below)*
43
42
-`log:` boolean indicates whether to write the log to console *(optional, default: false)*
44
-
-`indexFile:` filename for index page *(optional, default: 'index.html')*
45
-
-`srcToLoad:` array of objects to load, specifies selectors and attribute values to select files for loading *(optional, see default value in `lib/defaults.js`)*
43
+
-`defaultFilename:` filename for index page *(optional, default: 'index.html')*
44
+
-`sources:` array of objects to load, specifies selectors and attribute values to select files for loading *(optional, see default value in `lib/defaults.js`)*
46
45
-`subdirectories:` array of objects, specifies subdirectories for extensions. If `null` all files will be saved to `directory`*(optional, see example below)*
47
46
48
47
@@ -69,19 +68,18 @@ and separate files into directories:
69
68
70
69
```javascript
71
70
scraper.scrape({
72
-
url:'http://nodejs.org/',
73
-
directory:'/path/to/save',
74
-
paths: [
75
-
{path:'/', filename:'index.html'},
76
-
{path:'/about', filename:'about.html'},
71
+
urls: [
72
+
'http://nodejs.org/', // Will be saved with default filename 'index.html'
0 commit comments