Apify Discord Mirror

Updated 5 months ago

enqueueLinksByClickingElements help

At a glance

The community member is encountering an error while using the enqueueLinksByClickingElements method from the utils.puppeteer module. The error message indicates that the requestQueue object is missing the expected properties fetchNextRequest and addRequest. The community member has imported the RequestQueue from the crawlee library, but is unsure where the issue lies.

In the comments, another community member suggests that the issue may be due to the missing await keyword in front of the RequestQueue.open() call. The original poster acknowledges this and thanks the commenter.

Another comment mentions an "Error: Request is already handled!" error, but there is no further explanation or resolution provided.

This is the code :
Plain Text
await utils.puppeteer.enqueueLinksByClickingElements({
        page,
        requestQueue: RequestQueue.open(),
        selector: 'li.pagination_next',
        label: 'category',
        forefront: true

    });

This is the error :
Plain Text
 Reclaiming failed request back to the list or queue. Expected property object `requestQueue` to have keys `["fetchNextRequest","addRequest"]` in object `options`


I have imported RequestQueue from crawlee, don't understand where it goes wrong
v
N
3 comments
Hey , you are missing an await in front of the RequestQueue.open().
stupid me... sorry. thank you very much
Plain Text
Error: Request is already handled!
Add a reply
Sign up and join the conversation on Discord