Apify and Crawlee Official Forum

Y
Yam
Offline, last seen 4 months ago
Joined August 30, 2024
The docs all have code like the following to use enqueueLinks where you can target a specific request queue.

Plain Text
const Apify = require('apify')
Apify.utils.enqueueLinks({ requestQueue: myQueue })


However this won't work within an ES module project (which is what is setup when you use the actor starter templates!). I've tried import {utils} from 'apify' but there does not appear to be a named export like that.

How do I access this API? All the docs seem to be referencing CJS which should probably be updated if the official templates are not using this. I looked at the type for the requestHandler contextual enqueueLinks and it appears to omit the requestQueue property so cannot override there.
10 comments
Y
v
A
Duplicated a custom apify actor that was working great, didn't really change anything but a few selectors and pointed at a new site. Unfortunately the actor seems to exit "successfully" after the first url (only start url) is handled. None of my logging shows anything is in the html returned, and enqueuelinks ofc does nothing, yet cheerio beleives the page request responded successfully.

How would I approach debugging this situation? I've so far checked that $('body').html() returns empty string and attempted using RESIDENTIAL proxy in local geolocation to the website in case it was clever blocking but no success.

The url being scraped is https://www.tesco.com/groceries/en-GB/shop/health-and-beauty/shampoo/all?page=1&count=48
5 comments
H
Y
J