An Apify scraper to scrape amazon reviews. Adapted from Scrapehero https://gist.github.com/scrapehero/cefaf014076b953f865a63ad453d507b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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