Skip to content

Instantly share code, notes, and snippets.

@WingofaGriffin
Last active August 13, 2019 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WingofaGriffin/fe262e5ad1219794ba33ef30fef0a692 to your computer and use it in GitHub Desktop.
Save WingofaGriffin/fe262e5ad1219794ba33ef30fef0a692 to your computer and use it in GitHub Desktop.
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