Skip to content

Commit

Permalink
Allow for the case where the reason is just whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBone committed Aug 9, 2018
1 parent 3ba6540 commit bb9fd06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scraper.js
Expand Up @@ -85,7 +85,7 @@ async function main() {
for (let element of $("h4.non_table_headers").get()) {
let address = $(element).text().trim().replace(/\s\s+/g, " ");
let applicationNumber = "";
let reason = "No description provided";
let reason = "";
let receivedDate = "";

for (let subElement of $(element).next("div").get()) {
Expand All @@ -108,7 +108,7 @@ async function main() {
await insertRow(database, {
applicationNumber: applicationNumber,
address: address,
reason: reason,
reason: ((reason.trim() === "") ? "No description provided" : reason),
informationUrl: DevelopmentApplicationMainUrl,
commentUrl: CommentUrl,
scrapeDate: moment().format("YYYY-MM-DD"),
Expand Down

0 comments on commit bb9fd06

Please sign in to comment.