Socket
Socket
Sign inDemoInstall

amazon-questions-crawler

Package Overview
Dependencies
191
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    amazon-questions-crawler

Crawls product questions from Amazon.


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Amazon Questions Crawler

Crawls product questions from Amazon.

Installation

Via npm:

npm install amazon-questions-crawler

Or Yarn:

yarn add amazon-questions-crawler

Usage

Load the module

var questionsCrawler = require('amazon-questions-crawler')

Get questions by a product ASIN

questionsCrawler('0062472100')
	.then(function(questions){
		console.log(questions)
	})
	.catch(function(err){
		console.error(err)
	})

This will return an object containing the title of the product and an array of questions data.

Example of a return:

{
	title: "Product Name",
	questions: [
		{
			id: "Tx2FZP4T1BTNF6K",
			question: "Amazon user question here?",
			link: "https://www.amazon.com/forum/-/Tx3S3D31UW3GXGH/ref=ask_ql_ql_al_hza?asin=B00LB33S0Y"
		}
	]
}

Options

Options can also be provided to change the user agent string, questions page, or elements being crawled.

Example:

reviewsCrawler('0062472100', {
		page: 'https://www.amazon.com/ask/questions/asin/{{asin}}/1/ref=ask_ql_psf_ql_hza?sort=SUBMIT_DATE',
		userAgent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0',
		elements: {
			// Searches whole page
			productTitle: '.askProductDescription a',
			questionBlock: '.askTeaserQuestions > div',
			// Searches within questionBlock
			question: 'a',
			link: 'a'
		},
		// Stops crawling when it hits a particular question ID
		// Useful for only crawling new questions
		stopAtQuestionId: false
	})
	.then(console.log)
	.catch(console.error)

Keywords

FAQs

Last updated on 18 Aug 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc