Welcome to AmazonStorePrice’s documentation!¶
Contents:
Getting Start¶
Link¶
Features¶
- Easy to find the price without using the Amazon API
- Easy to use
- Python 3.x +
- Unittest
- Custom Errors
Installation via Pip¶
pip install amazonstoreprice
Installation from Source¶
git clone https://github.com/Mirio/amazonstoreprice.git
cd amazonstoreprice
python setup.py install
Uninstall via Pip¶
pip uninstall amazonstoreprice
Basic usage¶
Code:
from amazonstoreprice import AmazonStorePrice
url = "http://www.amazon.it/Inside-Out-Ronnie-Del-Carmen/dp/B016LMC90O/" \
"ref=sr_1_1?ie=UTF8&qid=1455389197&sr=8-1&keywords=inside+out"
pricelib = AmazonStorePrice()
print(pricelib.getprice(url, retry_ontemp=True))
Output:
$ python example_getprice.py
15.99
Module Documentation¶
-
class
amazonstoreprice.
AmazonStorePrice
¶ -
getpage
(url, retry_ontemp=False)¶ Get the page and raise if status_code is not equal to 200
Parameters: - url(string) – normalized(url)
- retry_ontemp(bool) – if true, retry on 503 error
Returns: bs4(html)
-
getprice
(url, retry_ontemp=False)¶ Find the price on AmazonStore starting from URL
Parameters: - url(string) – url
- retry_ontemp(bool) – if true, retry on 503 error
Returns: float(price cleaned)
-
normalizeprice
(price)¶ remove the currenty from price
Parameters: price(string) – price tag find on amazon store Returns: float(price cleaned)
-
normalizeurl
(url)¶ clean the url from referal and other stuff
Parameters: url(string) – amazon url Returns: string(url cleaned)
-