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 psnstoreprice
Installation from Source¶
git clone https://github.com/Mirio/psnstoreprice.git
cd psnstoreprice
python setup.py install
Uninstall via Pip¶
pip uninstall psnstoreprice
Basic usage¶
Code:
from psnstoreprice import PsnStorePrice
url = "https://store.playstation.com/#!/en-ie/games/earth-defense-force-41-the-shadow-of-new-despair/" \
"cid=EP4293-CUSA03467_00-EARTHDEFENSEFO41"
pricelib = PsnStorePrice()
print(pricelib.getprice(url))
Output:
$ python example_getprice.py
64.99
Module Documentation¶
-
class
psnstoreprice.
PsnStorePrice
¶ -
getpage
(url, sleep_time=5)¶ Get the page and raise if status_code is not equal to 200
Parameters: - url(string) – normalized(url)
- sleep_time(int) – Time to wait until take the data (default 5s)
Returns: bs4(html)
-
getprice
(url, sleep_time=5)¶ Find the price on AmazonStore starting from URL
Parameters: - url(string) – url
- sleep_time(int) – Time to wait until take the data (default 5s)
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 and check if all element required is present
Parameters: url(string) – PSN store url Returns: string(url cleaned)
-