Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
An Apify scraper to scrape amazon reviews. Adapted from Scrapehero https://gist.github.com/scrapehero/cefaf014076b953f865a63ad453d507b
// Link selector: li.a-last a
async function pageFunction(context) {
const { request, log, jQuery } = context;
var $ = context.jQuery;
var result = [];
$("div.review").each( function() {
result.push({
rating: $(this).find("span.a-icon-alt").text().charAt(0),
title : $(this).find("a.a-size-base.review-title").text(),
content : $(this).find("div.a-row.review-data span.a-size-base").text(),
author : $(this).find("span.a-profile-name").text(),
date : $(this).find("span.a-size-base.a-color-secondary").text(),
});
});
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment