Skip to content

Commit 9153918

Browse files
author
sts-ryan-holton
authored
Merge pull request #4 from sts-ryan-holton/dev
Dev
2 parents 60b18ad + 5fb8eb0 commit 9153918

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ $ git clone [email protected]:sts-ryan-holton/loan-risk-score.git
5959
$ npm install
6060
```
6161

62+
:warning: You will need to **enable** the scraper, and provide a URL to scrape. We've provided an example that you can copy.
63+
6264
### :wrench: Starting
6365

6466
``` bash

docs/index.html

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "loan-risk-score",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Calculate loan affordability using machine learning.",
55
"main": "scraper/scrape-jobs.js",
66
"keywords": [

scraper/data/salary.json

Lines changed: 0 additions & 1 deletion
Large diffs are not rendered by default.

scraper/scrape-jobs.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ var searchRadius = (args['searchRadius'] && args['searchRadius'] != '') ? pars
1717
scrapeInterval = (args['scrapeInterval'] && args['scrapeInterval'] != '') ? parseInt(args['scrapeInterval']) : 1000,
1818
pauseDelay = (args['thresholdDelay'] && args['thresholdDelay'] != '') ? parseInt(args['thresholdDelay']) : 7500,
1919
pauseScraping = false,
20-
scrapeOnRun = true,
21-
urlToScrape = 'https://www.indeed.co.uk/jobs?l=Bridgend',
20+
scrapeOnRun = false,
21+
urlToScrape = '', // example: https://www.indeed.co.uk/jobs?l=London
2222
jobCard = '.jobsearch-SerpJobCard',
2323
jobCardSalary = '.salarySnippet .salaryText'
2424

@@ -165,7 +165,7 @@ async function scrapeWebsite(radius, pageNo) {
165165

166166

167167
// run the scraper on loop and increment details
168-
if (scrapeOnRun) {
168+
if (scrapeOnRun && urlToScrape != '') {
169169
setInterval(() => {
170170
if (!pauseScraping) {
171171
scrapeWebsite(searchRadius, pageNumber)
@@ -175,6 +175,9 @@ if (scrapeOnRun) {
175175

176176

177177
// run the scraper on start
178-
if (scrapeOnRun) {
178+
if (scrapeOnRun && urlToScrape != '') {
179179
scrapeWebsite(searchRadius, pageNumber)
180180
}
181+
182+
if (urlToScrape == '') console.log('=== ERROR: You\'ll need to add a URL in: "scraper/scrape-jobs.js, line: 21" to scrape. ===')
183+
if (!scrapeOnRun) console.log('=== ERROR: You\'ll need to enable the scraper in: "scraper/scrape-jobs.js, line: 20". ===')

0 commit comments

Comments
 (0)