Reputation: 905
Currently using page.find('/folder_name').media.images
to extract images and setting limit in for loop. But no way to randomize them. And setting limit in for loop is I believe not a good way of doing it. Could anybody help?
Here I am asking for gallery. The suggested method works on articles but not on media collection.
Upvotes: 1
Views: 504
Reputation: 905
Got success. I used randomize function as follows to random my image collection with slice to limit it to only 50 images.
image_album = page.find('/folder_name').media.images|randomize()|slice(0,50)
This works for me and gave desired result.
Upvotes: 2