Feb 16, 2017
People Also Bought
This is the outcome of a little scraping experiment using python and selenium. The script take a query as an argument and will then open up Firefox browser by itself, navigate to Amazon, search for the query and click on a random item result. Then it saves the image of that item, clicks on a random “Customers Who Bought This Item Also Bought” item and repeats the procedure.
The hope was for a stream of images that softly and meaningfully(-ish) transition from one to another.
One problem is that the results often end up in loops between the same 2 or more items - if I have some time, there is definitely some way to improve on that (e.g. right now I am only grabbing the first batch of suggested items; grabbing more would probably allow for more diversity).
That said, it can be nice to watch the program remaining in a loop for a while before doing one lucky pick and moving on to new items.
Below two examples. “communistmanifesto” started with the book, went through a whole lot of other books before going down a yoga route that turned sensual very quickly. Finally it got stuck in a eternal Relax-Relief massage oil limbo.
"People Also Bought" with query "communistmanifesto"
“merkel” started of with a face-mask of the german chancellor, then cycled through all the other celebs one could think of before hitting Nicolas Cage and getting into other, strange regions of amazon featuring “Cookin’ with Coolio” cook book and a “Office Voodo Kit”. Then this also got stuck in a loop of witty stamps. Great!
"People Also Bought" with query "merkel"
Code is here.