From bf2e10924cc4df939bd0b80b974a05d22326ca1d Mon Sep 17 00:00:00 2001 From: Dominic Jones Date: Wed, 4 Sep 2019 13:53:34 +0100 Subject: [PATCH] Update scraper.js --- scraper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scraper.js b/scraper.js index 9d2e328..2cbe35c 100644 --- a/scraper.js +++ b/scraper.js @@ -59,7 +59,7 @@ function run(db) { readRows(db); }); // Use request to read in pages. - fetchPage("https://liv-cycling.com/gb/bikes", function (body) { + fetchPage("https://www.liv-cycling.com/gb/bikes", function (body) { // Use cheerio to find things in the page with css selectors. var $ = cheerio.load(body); @@ -67,7 +67,7 @@ function run(db) { var bikeName = $(this).find('div.caption h3').text().trim(); var imgUrl = $(this).find('picture.image img').attr('src'); var price= $(this).find('div.caption p.prices').text(); - var buyLink = 'https://liv-cycling.com' + $(this).find('a').attr('href'); + var buyLink = 'https://www.liv-cycling.com' + $(this).find('a').attr('href'); updateRow(db, bikeName, imgUrl, price, buyLink); });