-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web Scraper Question #88
Comments
Hm, is the |
How would I check if it were firing multiple times? When I try to comment out res.send, it still works in the browser but the server still crashes.
… On Mar 23, 2017, at 3:26 PM, Adrian Maseda ***@***.***> wrote:
Hm, is the .filter callback executing multiple times? If so, running res.send( ) might be what's causing that error.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#88 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AXqfma3cDaNTePFRDrlzkMAmx4u5LVzmks5rosdigaJpZM4Mm_KL>.
|
Hey Adrian,
Isaac got it, apparently we needed to switch res.send to res.write.
… On Mar 23, 2017, at 3:26 PM, Adrian Maseda ***@***.***> wrote:
Hm, is the .filter callback executing multiple times? If so, running res.send( ) might be what's causing that error.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#88 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AXqfma3cDaNTePFRDrlzkMAmx4u5LVzmks5rosdigaJpZM4Mm_KL>.
|
Oh word, awesome! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We are building a web scraper and it works the first time you deploy it, but then the node server crashes and it cant be used again. Below is our code and the error we get:
Error:
[nodemon] starting
node index.js
Scraping faces on 4k
_http_outgoing.js:367
throw new Error('Can't set headers after they are sent.');
^
Error: Can't set headers after they are sent.
at ServerResponse.setHeader (_http_outgoing.js:367:11)
at ServerResponse.header (/Users/natashaclark/wdi/Lab/sweet-libs/node_modules/express/lib/response.js:725:10)
at ServerResponse.send (/Users/natashaclark/wdi/Lab/sweet-libs/node_modules/express/lib/response.js:170:12)
at Object. (/Users/natashaclark/wdi/Lab/sweet-libs/index.js:24:13)
at testFn (/Users/natashaclark/wdi/Lab/sweet-libs/node_modules/cheerio/lib/api/traversing.js:320:22)
at /Users/natashaclark/wdi/Lab/sweet-libs/node_modules/lodash.filter/index.js:869:9
at /Users/natashaclark/wdi/Lab/sweet-libs/node_modules/lodash.filter/index.js:1255:11
The text was updated successfully, but these errors were encountered: