Skip to content

How can I re-queue a URL? #942

Closed
Closed

Description

@matecsaj

Crawlee optimizes requests by suppressing redundant URLs and giving up on a URL after reaching a configurable retry limit. This is great, but I encountered an edge case.

Situation: You're extracting data from a page and realize that it wasn’t downloaded properly.

Ideal Goal: Re-queue the URL while decrementing its retry counter.

Alternative: Add the URL back to the queue with a fresh retry counter.

How can I achieve either of these?

Activity

  1. added
    t-tooling
    on Jan 29, 2025
  2. B4nan commented on Jan 29, 2025

    @B4nan
    Member

    You can enqueue it again with a different unique_key, that's what we use for deduplication (and it defaults to the URL itself).

  3. vdusek commented on Jan 30, 2025

    @vdusek
    Collaborator

    Ideal Goal: Re-queue the URL while decrementing its retry counter.

    I am afraid this is not possible.

    Add the URL back to the queue with a fresh retry counter.

    You can use the always_enqueue=True:

    request = Request.from_url('https://crawlee.dev/', always_enqueue=True)

    which will generate "unique" unique_key under the hood. And add the request to the request queue.

  4. locked and limited conversation to collaborators on Jan 30, 2025
  5. converted this issue into a discussion #944 on Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-tooling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions