rubber-blueR
Apify & Crawlee4y ago
8 replies
rubber-blue

Remove items from dataset output

Hi Guys, so im using this instagram scraper to get some posts info from instagram, works fine except it outputs far more info than i need, and the data ends up in different columns every-time to due to this. What im trying to do is use the extendoutputfucntion to remove the below items from the output, this used to work fine but something in the scraper changed and now the code looks all janky and i cant work out where its wrong? i have a feeling its those /n parts as i dont remember those being there previously? any ideas thanks heaps fam

{
    "extendOutputFunction": "async ({ data, item, helpers, page, customData, label }) => {\ndelete item.hashtags;\ndelete item.mentions;\ndelete item.position;\ndelete item.commentsCount;\ndelete item.dimensionsHeight;\ndelete item.dimensionsWidth;\ndelete item.latestComments;\ndelete item.childPosts;\ndelete item.id;\ndelete item.likesCount;\ndelete item.locationName;\ndelete item.locationId;\ndelete item.ownerFullName;\ndelete item.ownerId;\ndelete item.shortCode;\ndelete item.type;\ndelete item.firstComment;\ndelete item.alt;\ndelete item.timestamp;\ndelete item.url;\ndelete item.images;\n\n\n  return item;\n}\n",
    "resultsLimit": 1,
    "username": [
        "subscription.box.australia"
    ]
}
Was this page helpful?