var express = require('express');
var router = express.Router();
var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');

/* GET home page. */
router.get('/home', function(req, res, next) {
  res.render('index', { title: 'Express' });
});

router.get('/scrape', function(req, res){
  
  url = 'http://www.amazon.com/s/ref=nb_sb_ss_c_0_9?url=search-alias%3Daps&field-keywords=hdmi+cable&sprefix=chromecast%2Caps%2C209';
  
  request(url, function(error, response, html){
		if(!error){
			var $ = cheerio.load(html);

			var title, price;
			var json = { title : "", price : ""};
      
      $('.a-size-medium a-color-null s-inline s-access-title a-text-normal').filter(function() {
        var data = $(this);
        title = data.text();
        json.title = title;
      });
      
      $('.a-size-base a-color-price s-price a-text-bold').filter(function() {
        var data = $(this);
        price = data.text();
        json.price = price;
      });
		
		}

		fs.writeFile('output.json', JSON.stringify(json, null, 4), function(err){
        	console.log('File successfully written! - Check your project directory for the output.json file');
        })

      res.json(json);
      })
  
  
});

module.exports = router;

@@ -612,35 +612,68 @@
 %7D;%0A      %0A      
+res.send(html);%0A      %0A      /*
 $('
+h2
 .a-size-medium a
@@ -1244,19 +1244,19 @@
 n(json);
-%0A  
+*/%0A
     %7D)%0A 

Update index.js