actor-scraper
actor-scraper copied to clipboard
Tutorial improvements
- The getting started guide doesn't mention how to enqueue requests manually, I found it somewhere in the SDK docs. Maybe giving an example of enqueueing requests manually in the getting started guide would be helpful for people starting out with writing a web-scraper.
- Again about the context.enqueueRequest() function I was not sure if I can use it asynchronously or not? for example, is it ok to pass an async function to each():
subCategoriesSelector.each(async function() {
// Suffix sub category link with a limit of 96
var scLink = $(this).attr('href').replace('#', '?limit=96');
//log.info(`SubCategory Link: ${scLink}`);
await context.enqueueRequest({
url:`${baseURL}/${scLink}`,
userData: {
"label": "LIST"
}
}
);