Skip to content

Commit

Permalink
Set the SSL version.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBone committed Jul 8, 2018
1 parent 11d9528 commit 625d244
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scraper.js
Expand Up @@ -10,7 +10,7 @@ let sqlite3 = require("sqlite3").verbose();
let urlparser = require("url");
let moment = require("moment");

const DevelopmentApplicationsUrl = "http://www.burnside.sa.gov.au/Planning-Business/Planning-Development/Development-Applications/Development-Applications-on-Public-Notification";
const DevelopmentApplicationsUrl = "https://www.burnside.sa.gov.au/Planning-Business/Planning-Development/Development-Applications/Development-Applications-on-Public-Notification";
const CommentUrl = "mailto:burnside@burnside.sa.gov.au";

// Sets up an sqlite database.
Expand Down Expand Up @@ -52,12 +52,19 @@ function insertRow(database, developmentApplication) {

function requestPage(url, callback) {
console.log(`Requesting page: ${url}`);
request(url, (error, response, body) => {
request.get({ uri: url, agentOptions: { secureProtocol: "TLSv1_method" } }, (error, response, body) => {
if (error)
console.log(`Error requesting page ${url}: ${error}`);
else
callback(body);
});

// request(url, (error, response, body) => {
// if (error)
// console.log(`Error requesting page ${url}: ${error}`);
// else
// callback(body);
// });
}

// Parses the page at the specified URL.
Expand Down

0 comments on commit 625d244

Please sign in to comment.