From 50e73252e0c7f144b4990ccd28e8319a8dc0852f Mon Sep 17 00:00:00 2001 From: AdrianLoer Date: Thu, 4 Apr 2019 01:48:05 +0200 Subject: [PATCH] fix CRI example failed previously with UnhandledPromiseRejectionWarning: TypeError: RemoteChromeWARCGenerator is not a constructor --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6ed23ec..be927c0 100755 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ parser.start() ```js const CRI = require('chrome-remote-interface') -const { RemoteChromeWARCGenerator, RemoteChromeCapturer } = require('node-warc') +const { RemoteChromeWARCWriter, RemoteChromeCapturer } = require('node-warc') ;(async () => { const client = await CRI() @@ -114,7 +114,7 @@ const { RemoteChromeWARCGenerator, RemoteChromeCapturer } = require('node-warc') await client.Page.navigate({ url: 'http://example.com' }); // actual code should wait for a better stopping condition, eg. network idle await client.Page.loadEventFired() - const warcGen = new RemoteChromeWARCGenerator() + const warcGen = new RemoteChromeWARCWriter() await warcGen.generateWARC(cap, client.Network, { warcOpts: { warcPath: 'myWARC.warc' @@ -194,4 +194,4 @@ The generateWARC method used in the preceding examples is helper function for ma the WARC generation process simple. See its implementation for a full example of WARC generation using node-warc -Or see one of the crawler implementations provided by [Squidwarc](https://github.com/N0taN3rd/Squidwarc/tree/master/lib/crawler). \ No newline at end of file +Or see one of the crawler implementations provided by [Squidwarc](https://github.com/N0taN3rd/Squidwarc/tree/master/lib/crawler).