Comments (9)
Use the git-version:
- npm uninstall crawler
- download from here
- npm install /path/to/crawler/
from node-crawler.
Thanks for you answer.
After apply what you says, I got this error :
/home/fabien/Projets/crawler_nodejs/node_modules/crawler/lib/crawler.js:178
response.uri = q.uri;
^
TypeError: Cannot set property 'uri' of undefined
at [object Object].callback (/home/fabien/Projets/crawler_nodejs/node_modules/crawler/lib/crawler.js:178:38)
at [object Object]. (/home/fabien/Projets/crawler_nodejs/node_modules/crawler/node_modules/request/main.js:150:67)
at [object Object].emit (events.js:64:17)
at Object._onTimeout (/home/fabien/Projets/crawler_nodejs/node_modules/crawler/node_modules/request/main.js:304:19)
at Timer.callback (timers.js:83:39)
from node-crawler.
To show why, I try this at crawler.js:178
request(q, function(error,response,body) {
console.log(error);
console.log(response);
response.uri = q.uri;
onContent(error,response,body,false);
});
Error : "ETIMEDOUT"
Response : undefined
I try with others domains but I got same errors
from node-crawler.
Ok, I find.
In you exemple, you ser 'timeout' to 60. But it's millisecond so got timeout.
Work well with :
var c = new Crawler({
"maxConnections":10,
"timeout":60*1000, // seconds
"debug":false,
"callback":function(error,result,$) {
console.log("Got page");
$("a").each(function(i,a) {
console.log(a.href);
//c.queue(a.href);
})
}
});
from node-crawler.
This works fine for me with git version of crawler:
var Crawler = require("crawler").Crawler,
c = new Crawler({
"maxConnections":10,
"callback":function(error,result,$) {
console.log("Got page");
$("a").each(function(i,a) {
console.log(a.href);
})
}
});
c.queue(["http://www.google.com"]);
from node-crawler.
Last think : thanks very much for your work, it's awesome !
from node-crawler.
Improvement : if domain doesn't exists, response is undefined and got fatal error.
So it should be great to add condition at crawler.js:178
request(q, function(error,response,body) {
if (response) {
response.uri = q.uri;
}
onContent(error,response,body,false);
});
from node-crawler.
Hi, I didn't made this, say thanks to the guys at Joshfire :)
Please close this issue if it's solved!
from node-crawler.
@Jellyfrog : about your try, add timeout: 60 as in simple.js and you got an error too
from node-crawler.
Related Issues (20)
- Detect Timeout Pages HOT 1
- How to skip URL with ECONNRESET or ETIMEDOUT errors HOT 3
- Can this tool actually crawl/spider, or just scrape pages? HOT 5
- maybe a bug ? HOT 1
- Maintained? HOT 1
- Crash ERR_INVALID_URL on Redirect HOT 1
- Queue size goes up and doesn't crawl new pages
- No retry when status code 404 HOT 1
- How to use with await? HOT 3
- Iconv-lite warning: decode()-ing strings is deprecated. HOT 2
- I would like to report a security concern HOT 1
- Jquery not work if response body is buffer HOT 2
- node-crawler.org url hijacked HOT 4
- Security concern HOT 1
- the encoding declaration in @types/crawler HOT 1
- cannot get section node HOT 4
- HTTP Agent with keepAlive HOT 1
- queue method should be a promise HOT 3
- Limit queue size HOT 2
- Dependency vulnerabilities
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-crawler.