mirror of
https://github.com/davidjohnbarton/crawler-google-places.git
synced 2025-12-12 16:38:45 +00:00
Updated infinite scroll
This commit is contained in:
parent
111048aee4
commit
6ee60e203c
|
|
@ -63,20 +63,16 @@ module.exports = async (page, maxHeight, elementToScroll = 'body') => {
|
|||
interceptedRequest.continue();
|
||||
});
|
||||
page.on('requestfailed', (interceptedRequest) => {
|
||||
if (maybeResourceTypesInfiniteScroll.includes(interceptedRequest.resourceType)) {
|
||||
if (pendingRequests[interceptedRequest._requestId]) {
|
||||
delete pendingRequests[interceptedRequest._requestId];
|
||||
++resourcesStats.failed;
|
||||
}
|
||||
}
|
||||
});
|
||||
page.on('requestfinished', (interceptedRequest) => {
|
||||
if (maybeResourceTypesInfiniteScroll.includes(interceptedRequest.resourceType)) {
|
||||
if (pendingRequests[interceptedRequest._requestId]) {
|
||||
delete pendingRequests[interceptedRequest._requestId];
|
||||
++resourcesStats.finished;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user