anderer Button läuft ein Stück, aber nicht weit
This commit is contained in:
parent
0266be624a
commit
221722b917
10
crawler.js
10
crawler.js
|
|
@ -35,9 +35,10 @@ if (plsStop === 1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function visitPage(pageToVisit, callback){
|
function visitPage(url, callback){
|
||||||
console.log("Visiting page " + pageToVisit);
|
console.log("Visiting page " + url);
|
||||||
request(pageToVisit, function(error, response, body) {
|
pagesVisited[url] = true;
|
||||||
|
request(url, function(error, response, body) {
|
||||||
if(error) {
|
if(error) {
|
||||||
console.log("Error: " + error);
|
console.log("Error: " + error);
|
||||||
}
|
}
|
||||||
|
|
@ -49,8 +50,7 @@ console.log("Visiting page " + pageToVisit);
|
||||||
console.log("Page title: " + $('title').text());
|
console.log("Page title: " + $('title').text());
|
||||||
// savePage($,crawl);
|
// savePage($,crawl);
|
||||||
// prepare next page
|
// prepare next page
|
||||||
console.log("Next up: " + $("#dk2next").text());
|
var nextPage = $('#next').attr('href');
|
||||||
var nextPage = $('#dk2next').attr('href');
|
|
||||||
console.log("Next up: " + nextPage);
|
console.log("Next up: " + nextPage);
|
||||||
if (nextPage){
|
if (nextPage){
|
||||||
pageToVisit = baseUrl + nextPage;
|
pageToVisit = baseUrl + nextPage;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue