Skip to main content

Scraping and parsing amazon

Project description

an

Scraping and parsing amazon

To install: pip install an

Amazon Scraping Library

Overview

This Python library is designed for scraping and parsing data from Amazon product pages. It offers functionalities to extract various information like sales ranks, product reviews, and product titles from Amazon's different regional websites.

Installation

This library is not a standalone package and should be incorporated directly into your existing Python project. Copy the code into your project's directory.

Dependencies

  • pandas
  • numpy
  • requests
  • BeautifulSoup
  • pymongo
  • matplotlib

Ensure these dependencies are installed in your environment.

Usage

Extracting Sales Rank

The library can extract sales ranks of products from Amazon. Here's an example of how to get the sales rank of a product:

asin = 'YOUR_PRODUCT_ASIN'
country = 'co.uk'  # Change to desired Amazon region
sales_rank = Amazon.get_sales_rank(asin=asin, country=country)
print(sales_rank)

Parsing Product Title

To parse and get the product title from an Amazon product page:

html_content = Amazon.slurp(what='product_page', asin=asin, country=country)
title = Amazon.parse_product_title(html_content)
print(title)

Getting Number of Reviews

To retrieve the number of customer reviews for a product:

number_of_reviews = Amazon.get_number_of_reviews(asin=asin, country=country)
print(number_of_reviews)

Contributing

Contributions to this library are welcome. Please send pull requests with improvements or bug fixes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

an-0.0.10.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

an-0.0.10-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file an-0.0.10.tar.gz.

File metadata

  • Download URL: an-0.0.10.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for an-0.0.10.tar.gz
Algorithm Hash digest
SHA256 335cf1115bfd53c0f93919f663a26b0c52002c6ea2bd86e2993ec31cd4f868e0
MD5 f5b357648badc4955c7de6255855ab80
BLAKE2b-256 d8abaadfe5d3a907010456dc9ca33ba4ee3bf595efc4dfe455638e1ff08bee0d

See more details on using hashes here.

File details

Details for the file an-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: an-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for an-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 1cbd9cfbfba73937db30cc5e494d01a54f17ee5a94c0319f9f75dbe48d671cda
MD5 b26c1c8f1eac975a910b041acd6531a6
BLAKE2b-256 9df046eda9c7e7893a3b683972d30689db2a324030a0efddb06be4f0ca79442a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page