Skip to content

Commit 09b7bd1

Browse files
aivusclaude
andauthored
Fix grammar and formatting issues in README (#642)
- Fix typos: "Thease"→"These", "coppied"→"copied", "occured"→"occurred" - Fix broken grammar in note and onResourceError description - Add missing space in "Parameters-" labels - Align mixed tab/space indentation in afterResponse example - Use ESM import instead of require in generateFilename example (package is pure ESM) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6fb0549 commit 09b7bd1

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
Download the website to the local directory (including all css, images, js, etc.)
1313

14-
**Note:** by default dynamic websites (where content is loaded by js) may be saved not correctly because `website-scraper` doesn't execute js, it only parses http responses for html and css files. If you need to download a dynamic website take a look at [website-scraper-puppeteer](https://github.com/website-scraper/website-scraper-puppeteer).
14+
**Note:** by default dynamic websites (where content is loaded by js) may not be saved correctly because `website-scraper` doesn't execute js, it only parses http responses for html and css files. If you need to download a dynamic website take a look at [website-scraper-puppeteer](https://github.com/website-scraper/website-scraper-puppeteer).
1515

1616
## Sponsors
1717
Maintenance of this project is made possible by all the [contributors](https://github.com/website-scraper/node-website-scraper/graphs/contributors) and [sponsors](https://github.com/sponsors/s0ph1e).
@@ -221,7 +221,7 @@ Plugins allow to extend scraper behaviour
221221
* [getReference](#getreference)
222222

223223
##### Built-in plugins
224-
Scraper has built-in plugins which are used by default if not overwritten with custom plugins. You can find them in [lib/plugins](lib/plugins) directory. Thease plugins are intended for internal use but can be coppied if the behaviour of the plugins needs to be extended / changed.
224+
Scraper has built-in plugins which are used by default if not overwritten with custom plugins. You can find them in [lib/plugins](lib/plugins) directory. These plugins are intended for internal use but can be copied if the behaviour of the plugins needs to be extended / changed.
225225

226226
##### Existing plugins
227227
* [website-scraper-puppeteer](https://github.com/website-scraper/website-scraper-puppeteer) - download dynamic (rendered with js) websites using puppeteer
@@ -231,7 +231,7 @@ Scraper has built-in plugins which are used by default if not overwritten with c
231231

232232
Plugin is object with `.apply` method, can be used to change scraper behavior.
233233

234-
`.apply` method takes one argument - `registerAction` function which allows to add handlers for different actions. Action handlers are functions that are called by scraper on different stages of downloading website. For example `generateFilename` is called to generate filename for resource based on its url, `onResourceError` is called when error occured during requesting/handling/saving resource.
234+
`.apply` method takes one argument - `registerAction` function which allows to add handlers for different actions. Action handlers are functions that are called by scraper on different stages of downloading website. For example `generateFilename` is called to generate filename for resource based on its url, `onResourceError` is called when error occurred during requesting/handling/saving resource.
235235

236236
You can add multiple plugins which register multiple actions. Plugins will be applied in order they were added to options.
237237
All actions should be regular or async functions. Scraper will call actions of specific type in order they were added and use result (if supported by action type) from last action call.
@@ -336,7 +336,7 @@ registerAction('afterResponse', ({response}) => {
336336
} else {
337337
return {
338338
body: response.body,
339-
encoding: 'utf8',
339+
encoding: 'utf8',
340340
metadata: {
341341
headers: response.headers,
342342
someOtherData: [ 1, 2, 3 ]
@@ -349,7 +349,7 @@ registerAction('afterResponse', ({response}) => {
349349
##### onResourceSaved
350350
Action onResourceSaved is called each time after a resource is saved (to file system or other storage with 'saveResource' action).
351351

352-
Parameters- object which includes:
352+
Parameters - object which includes:
353353
* resource - [Resource](https://github.com/website-scraper/node-website-scraper/blob/master/lib/resource.js) object
354354

355355
Scraper ignores the result returned from this action and does not wait until it is resolved
@@ -358,9 +358,9 @@ registerAction('onResourceSaved', ({resource}) => console.log(`Resource ${resour
358358
```
359359

360360
##### onResourceError
361-
Action onResourceError is called each time when resource's downloading/handling/saving to was failed
361+
Action onResourceError is called each time a resource's downloading/handling/saving fails
362362

363-
Parameters- object which includes:
363+
Parameters - object which includes:
364364
* resource - [Resource](https://github.com/website-scraper/node-website-scraper/blob/master/lib/resource.js) object
365365
* error - Error object
366366

@@ -384,7 +384,7 @@ If multiple actions `generateFilename` added - scraper will use result from last
384384
Default plugins which generate filenames: [byType](https://github.com/website-scraper/node-website-scraper/blob/master/lib/plugins/generate-filenamy-by-type-plugin.js), [bySiteStructure](https://github.com/website-scraper/node-website-scraper/blob/master/lib/plugins/generate-filenamy-by-site-structure-plugin.js)
385385
```javascript
386386
// Generate random filename
387-
const crypto = require('crypto');
387+
import crypto from 'crypto';
388388
registerAction('generateFilename', ({resource}) => {
389389
return {filename: crypto.randomBytes(20).toString('hex')};
390390
});

0 commit comments

Comments
 (0)