Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
- 1: node::Abort() [node]
- 2: 0x10d3f9c [node]
- 3: v8::Utils::ReportApiFailure(char const*, char const*) [node]
- 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
- 5: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node]
- 6: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node]
- 7: 0x292aec062bf
- Aborted
- var express = require('express');
- var path = require('path');
- var request = require('request');
- var cheerio = require('cheerio');
- var fs = require('fs');
- var app = express();
- var count = 1;
- var url;
- while(count != 10){
- url = "http://www.ratemyprofessors.com/ShowRatings.jsp?tid=" + count;
- request(url, function(err, resp, body){
- var $ = cheerio.load(body);
- if($('.error').text().substring(0, 14) == "Page Not Found"){
- console.log("hello");
- count++;
- return;
- }else{
- console.log($('.error').text().substring(0, 14) );
- var pfname = $('.pfname');
- var plname = $('.plname');
- var professorName = pfname.text().replace(/s/g, '') + " " +plname.text().replace(/s/g, '');
- console.log(professorName);
- console.log(url);
- count++;
- }
- return;
- })
- }
- app.listen(3000, function(){
- console.log("server is now listening");
- })
Add Comment
Please, Sign In to add comment