# 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:
```python
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:
```python
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:
```python
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/thorwhalen/uu/tree/master/an",
"name": "an",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Thor Whalen",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/6c/09/74f678b979b6a2a1ccb7626d2a82b0c1cdba49b1440469c56d9df1ad1b7d/an-0.0.7.tar.gz",
"platform": "any",
"description": "\n# an\nScraping and parsing amazon\n\n\nTo install:\t```pip install an```\n\n\n# Amazon Scraping Library\n\n## Overview\nThis 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.\n\n## Installation\nThis library is not a standalone package and should be incorporated directly into your existing Python project. Copy the code into your project's directory.\n\n## Dependencies\n- pandas\n- numpy\n- requests\n- BeautifulSoup\n- pymongo\n- matplotlib\n\nEnsure these dependencies are installed in your environment.\n\n\n## Usage\n\n### Extracting Sales Rank\nThe library can extract sales ranks of products from Amazon. Here's an example of how to get the sales rank of a product:\n\n```python\nasin = 'YOUR_PRODUCT_ASIN'\ncountry = 'co.uk' # Change to desired Amazon region\nsales_rank = Amazon.get_sales_rank(asin=asin, country=country)\nprint(sales_rank)\n```\n\n### Parsing Product Title\n\nTo parse and get the product title from an Amazon product page:\n\n```python\nhtml_content = Amazon.slurp(what='product_page', asin=asin, country=country)\ntitle = Amazon.parse_product_title(html_content)\nprint(title)\n```\n\n### Getting Number of Reviews\nTo retrieve the number of customer reviews for a product:\n\n```python\nnumber_of_reviews = Amazon.get_number_of_reviews(asin=asin, country=country)\nprint(number_of_reviews)\n```\n\n## Contributing\nContributions to this library are welcome. Please send pull requests with improvements or bug fixes.\n\n",
"bugtrack_url": null,
"license": "apache-2.0",
"summary": "Scraping and parsing amazon",
"version": "0.0.7",
"project_urls": {
"Homepage": "https://github.com/thorwhalen/uu/tree/master/an"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2f61f4e1b32732ff9b1c313f300db0c5e8ef8894a2b2a28396cb2ce478327d81",
"md5": "5c295c19afd01d6db220b19764f37897",
"sha256": "ff692ec27977f09002eacc844923580464afd45d6254819002538153821f3cd2"
},
"downloads": -1,
"filename": "an-0.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5c295c19afd01d6db220b19764f37897",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10630,
"upload_time": "2024-01-17T08:32:06",
"upload_time_iso_8601": "2024-01-17T08:32:06.680460Z",
"url": "https://files.pythonhosted.org/packages/2f/61/f4e1b32732ff9b1c313f300db0c5e8ef8894a2b2a28396cb2ce478327d81/an-0.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6c0974f678b979b6a2a1ccb7626d2a82b0c1cdba49b1440469c56d9df1ad1b7d",
"md5": "a699a8651f485b0b4904063a44a8c355",
"sha256": "a2fef95f8701526d40903677084ff0a01a1896dceb9ddc44d6f4d97011fb17e8"
},
"downloads": -1,
"filename": "an-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "a699a8651f485b0b4904063a44a8c355",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10446,
"upload_time": "2024-01-17T08:32:08",
"upload_time_iso_8601": "2024-01-17T08:32:08.020935Z",
"url": "https://files.pythonhosted.org/packages/6c/09/74f678b979b6a2a1ccb7626d2a82b0c1cdba49b1440469c56d9df1ad1b7d/an-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-17 08:32:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thorwhalen",
"github_project": "uu",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "an"
}