Skip to content

Option to not cache entry URLs #1322

Answered by mnmkng
SeeYangZhi asked this question in Q&A
Mar 31, 2022 · 2 comments · 5 replies
Discussion options

You must be logged in to vote

It's a bit verbose, but I wanted to make it clear what's going on:

import Apify from 'apify'

const repeatableRequests = []

const requestQueue = await Apify.openRequestQueue();

// You can do this only once. The requests will stay in the queue until you delete the file.
const { request } = await requestQueue.addRequest({ url: 'https://example.com' })
repeatableRequests.push(request)

// But you need to save the information about the requests for the subsequent runs.
await Apify.setValue('repeatable-requests', repeatableRequests);


// run the crawler normally
const crawler = new Apify.CheerioCrawler({
    requestQueue,
    handlePageFunction: async ({ request }) => {
        console.log(r…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@SeeYangZhi
Comment options

@mnmkng
Comment options

@SeeYangZhi
Comment options

Comment options

You must be logged in to vote
2 replies
@SeeYangZhi
Comment options

@mnmkng
Comment options

Answer selected by SeeYangZhi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants