From f7aa9dd18300f207c1278681e706fab5edfefa82 Mon Sep 17 00:00:00 2001 From: yujiosaka Date: Tue, 5 Dec 2017 19:51:32 +0900 Subject: [PATCH] Update README.md --- README.md | 21 +++++++++++++++++++++ examples/README.md | 10 ---------- 2 files changed, 21 insertions(+), 10 deletions(-) delete mode 100644 examples/README.md diff --git a/README.md b/README.md index 31ce96cc..ec23d5ed 100644 --- a/README.md +++ b/README.md @@ -138,3 +138,24 @@ When both defined, hccrawler.queue's options are always preferred. #### hccrawler.queueSize * returns: <[number]> The size of queues. This property is read only. + +## Debugging tips + +### Puppeteer.launch's options + +[hccrawler.launch](#chcrawlerlaunchoptions)'s options are passed straight to [Puppeteer.launch API](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions). +It may be useful to set the `headless` and `slowMo` options so that you can see what is going on. + +```js +hccrawler.launch({ headless: false, slowMo: 10 }); +``` + +### Enable debug logging + +All requests and browser's logs are logged via the [debug]'(https://github.com/visionmedia/debug)' module under the `hccrawler` namespace. + +``` +env DEBUG="hccrawler:*" node script.js +env DEBUG="hccrawler:request" node script.js +env DEBUG="hccrawler:browser" node script.js +``` diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 07c38f7d..00000000 --- a/examples/README.md +++ /dev/null @@ -1,10 +0,0 @@ -## Debugging tips - -### Puppeteer options - -[hccrawler.launch](https://github.com/yujiosaka/headless-chrome-crawler#chcrawlerlaunchoptions)'s options are passed straight to [Puppeteer.launch API](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions). -It may be useful to set the `headless` and `slowMo` options so that you can see what is going on. - -```js -crawler.launch({ headless: false, slowMo: 10 }); -```