Skip to content

Commit

Permalink
Corrected the pipe.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBone committed Sep 11, 2018
1 parent fef9713 commit 2b02fff
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scraper.js
Expand Up @@ -101,11 +101,10 @@ function parsePdfs(database, url) {
// strings, being the text that has been parsed from the PDF.

let pdfParser = new pdf2json();
request({ url: pdfUrl, encoding: null }).pipe(pdfParser)
.on("pdfParser_dataError", error => console.error(error))
.on("error", function() { console.log("Error"); })
.on("finish", function() { console.log("Finish"); })
.on("pdfParser_dataReady", pdf => {
request({ url: pdfUrl, encoding: null })
.pipe(pdfParser)
.on("pdfParser_dataError", error => { console.error(error); })
.on("pdfParser_dataReady", pdf => {
// Convert the JSON representation of the PDF into a collection of PDF rows.

console.log(`Parsing PDF: ${pdfUrl}`);
Expand Down

0 comments on commit 2b02fff

Please sign in to comment.