This module helps in getting the price or title of a product
Project description
KRINN
This module helps you in getting the price or title of a product by simply using a URL or a Product ID. A product ID is available in the link itself.
Installation
Run the following to install:
pip install krinn
Please Note
For now crawling of products like book or multiple proce based on size are not supported.
Usage
shorten the url
from krinn import amazon
shorturl = amazon.short("https://www.amazon.in/Zebronics-100HB-High-Speed-Port/dp/B07GLNJC25/ref=sr_1_1_sspa?keywords=usb+hub&qid=1583729190&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExRzg4NTU3SFFCNk5JJmVuY3J5cHRlZElkPUEwODY2NTY4MkxDUUpOVlBPUks4QyZlbmNyeXB0ZWRBZElkPUEwNzk1MjU3NEZUNVJJNkdGVzYwJndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==")
print("Short URL:",shorturl)
Output:
Short URL: https://www.amazon.in/dp/B07GLNJC25/
Get the id using link
The ID of the product is in the url itself. To get the id of the link use this function.
from krinn import amazon
product_id = amazon.getid("https://www.amazon.in/Zebronics-100HB-High-Speed-Port/dp/B07GLNJC25/ref=sr_1_1_sspa?keywords=usb+hub&qid=1583729190&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExRzg4NTU3SFFCNk5JJmVuY3J5cHRlZElkPUEwODY2NTY4MkxDUUpOVlBPUks4QyZlbmNyeXB0ZWRBZElkPUEwNzk1MjU3NEZUNVJJNkdGVzYwJndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==")
print("Product ID:",product_id)
Output:
Product ID: B07GLNJC25
crawl by id
from krinn import amazon
byid = amazon.crawlbyid("B07GLNJC25")
print("By ID: ",byid)
Output:
By ID: ['Zebronics ZEB-100HB USB hubs with 4 Ports', 340.0]
crawl by url
from krinn import amazon
url = "https://www.amazon.in/dp/B07GLNJC25/"
byurl = amazon.crawlbyurl(url)
print("\nBy URL: ",byurl)
Output:
By URL: ['Zebronics ZEB-100HB USB hubs with 4 Ports', 340.0]
get title of the product
from krinn import amazon
url = "https://www.amazon.in/dp/B07GLNJC25/"
title = amazon.producttitle(url)
print("\nTitle:",title)
Output:
Title: Zebronics ZEB-100HB USB hubs with 4 Ports
get price of the product
from krinn import amazon
url = "https://www.amazon.in/dp/B07GLNJC25/"
price = amazon.productprice(url)
print("\nPrice:",price)
Output:
Price: 340.0
Upcoming Features
- Number of Rating of the current product.
- How many stars out of 5.
- And many more.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file krinn-0.0.1.tar.gz.
File metadata
- Download URL: krinn-0.0.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d70b18a816f2c9db65b5b2779d29e004021cc02045af9bbea066c259ad905b3f
|
|
| MD5 |
0a57aafa185aa722b7b621a42dd076fa
|
|
| BLAKE2b-256 |
0be0e858d438138c6fe438d43fa00ac0586142ac9415a212a99f2c36de109276
|
File details
Details for the file krinn-0.0.1-py3-none-any.whl.
File metadata
- Download URL: krinn-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d14c199a9358410a772a241fa862c81af8f38fe83d8be8584c26b941bad3f19
|
|
| MD5 |
70c3fae4421aa887506424e54872447d
|
|
| BLAKE2b-256 |
6d785eea2be876cd92949172bdfbff9c5a6ce238d08756d199449a49bf4f97f0
|