Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/purposeachiever6/ecommerce-scraper-py
Scrape ecommerce websites such as Amazon, eBay, Walmart, Home Depot, Google Shopping from a single module in Python🐍
https://github.com/purposeachiever6/ecommerce-scraper-py
Last synced: about 1 month ago
JSON representation
Scrape ecommerce websites such as Amazon, eBay, Walmart, Home Depot, Google Shopping from a single module in Python🐍
- Host: GitHub
- URL: https://github.com/purposeachiever6/ecommerce-scraper-py
- Owner: PurposeAchiever6
- License: mit
- Created: 2024-08-09T04:44:59.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-09T04:45:27.000Z (5 months ago)
- Last Synced: 2024-08-22T20:19:05.507Z (4 months ago)
- Language: Python
- Size: 139 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Python E-Commerce Scraper 🛒
Scrape Amazon, eBay, Walmart, Home Depot and Google Shopping from a single Python module.
This tool uses [SerpApi](https://serpapi.com/) as a tool to parse data.
You can use provided API key that will be available after installation, however, it's purely for testing purposes to see if the tool fits your needs. If you'll be using it for your own purpose (personal or commercial), you have to use [your own SerpApi key](https://serpapi.com/manage-api-key).
## ⚙️Installation
```bash
$ pip install ecommerce-scraper-py
```## Scrape Google Shopping
#### Example to scrape search page
```python
from google_shopping import GoogleShoppingSearchscraper = GoogleShoppingSearch(
api_key='',
query='coffee',
domain='google.de',
country='de',
language='de',
price_from=20,
price_to=200,
results_limit=150
)products = scraper.get_products()
scraper.print(products)scraper.save_to_json(products)
```___
#### Example to scrape product page
```python
from google_shopping import GoogleShoppingProductscraper = GoogleShoppingProduct(
api_key='',
product_id=14019378181107046593,
reviews_limit=125
)product = scraper.get_product()
scraper.print(product)scraper.save_to_json(product)
```___
#### Advanced example
```python
from google_shopping import GoogleShoppingSearch, GoogleShoppingProductsearch_scraper = GoogleShoppingSearch(
api_key='',
query='Sony PlayStation 5',
price_from=400,
price_to=1000,
results_limit=10,
domain='google.de',
country='de',
language='de'
)data = []
products = search_scraper.get_products()
for product in products:
product_scraper = GoogleShoppingProduct(
api_key='',
product_id=product['product_id'],
reviews_limit=15,
domain='google.de',
country='de',
language='de'
)product_data = product_scraper.get_product()
data.append(product_data)search_scraper.print(data)
search_scraper.save_to_json(data)
```## Scrape Walmart
#### Example to scrape search page
```python
from walmart import WalmartSearchscraper = WalmartSearch(
api_key='',
query='coffee starbucks',
price_from=20,
price_to=200,
results_limit=150,
# store="356"
)products = scraper.get_products()
scraper.print(products)scraper.save_to_json(products)
```___
#### Example to scrape product page
```python
from walmart import WalmartProductscraper = WalmartProduct(
api_key='',
product_id=520468661,
reviews_limit=125
)product = scraper.get_product()
scraper.print(product)scraper.save_to_json(product)
```___
#### Advanced example
```python
from walmart import WalmartSearch, WalmartProductsearch_scraper = WalmartSearch(
api_key='',
query='coffee starbucks',
price_from=20,
price_to=200,
results_limit=10
)data = []
products = search_scraper.get_products()
for product in products:
product_scraper = WalmartProduct(
api_key='',
product_id=product['product_id'],
reviews_limit=15
)product_data = product_scraper.get_product()
data.append(product_data)search_scraper.print(data)
search_scraper.save_to_json(data)
```## Scrape Home Depot
#### Example to scrape search page
```python
from home_depot import HomeDepotSearchscraper = HomeDepotSearch(
api_key='',
query='chair',
price_from=20,
price_to=200,
results_limit=150,
# zip_code='04401' # zip code must be in the format '12345' or '12345-6789'
)products = scraper.get_products()
scraper.print(products)scraper.save_to_json(products)
```___
#### Example to scrape product page
```python
from home_depot import HomeDepotProductscraper = HomeDepotProduct(
api_key='',
product_id=202054749
)product = scraper.get_product()
scraper.print(product)scraper.save_to_json(product)
```___
#### Advanced example
```python
from home_depot import HomeDepotSearch, HomeDepotProductsearch_scraper = HomeDepotSearch(
api_key='',
query='chair',
price_from=20,
price_to=200,
results_limit=10,
zip_code='04401' # zip code must be in the format '12345' or '12345-6789'
)data = []
products = search_scraper.get_products()
for product in products:
product_scraper = HomeDepotProduct(
api_key='',
product_id=product['product_id']
)product_data = product_scraper.get_product()
data.append(product_data)search_scraper.print(data)
search_scraper.save_to_json(data)
```## Scrape Amazon
#### Example to scrape search page
```python
from amazon import AmazonSearchscraper = AmazonSearch(
query='coffee',
results_limit=125,
price_from=20,
price_to=50,
currency='USD',
language='en_US',
customer_reviews_rating=4,
multiplier=1
)products = scraper.get_products()
scraper.print(products)scraper.save_to_json(products)
```___
#### Example to scrape product page
```python
from amazon import AmazonProductscraper = AmazonProduct(
link='https://www.amazon.com/McCafe-Premium-Roast-Decaf-Coffee/dp/B07GCNDL91/ref=sr_1_1?currency=USD&keywords=coffee&qid=1684849762&refinements=p_36%3A2000-5000%2Cp_72%3A1248897011&rnid=1248895011&s=grocery&sr=1-1&th=1',
reviews_limit=35,
multiplier=1,
currency='USD',
language='en_US'
)product = scraper.get_product()
scraper.print(product)scraper.save_to_json(product)
```___
#### Advanced example
```python
from amazon import AmazonSearch, AmazonProductsearch_scraper = AmazonSearch(
query='coffee',
results_limit=5,
price_from=20,
price_to=50,
currency='USD',
language='en_US',
customer_reviews_rating=4,
multiplier=1
)data = []
products = search_scraper.get_products()
for product in products:
product_scraper = AmazonProduct(
link=product['link'],
reviews_limit=15,
multiplier=1,
currency='USD',
language='en_US'
)product_data = product_scraper.get_product()
data.append(product_data)search_scraper.print(data)
search_scraper.save_to_json(data)
```## Scrape eBay
#### Example to scrape search page
```python
from ebay import EbaySearchscraper = EbaySearch(
api_key='',
query='coffee starbucks',
price_from=20,
price_to=200,
results_limit=250,
domain='ebay.com'
)products = scraper.get_products()
scraper.print(products)scraper.save_to_json(products)
```___
#### Example to scrape product page
```python
from ebay import EbayProductscraper = EbayProduct(
link='https://www.ebay.com/itm/2-Bags-STARBUCKS-French-Roast-DARK-Whole-Bean-100-Arabica-Coffee-40oz-ea-09-23/144356021636',
reviews_limit=125,
multiplier=1
)product = scraper.get_product()
scraper.print(product)scraper.save_to_json(product)
```___
#### Advanced example
```python
from ebay import EbaySearch, EbayProductsearch_scraper = EbaySearch(
api_key='',
query='coffee',
results_limit=5,
domain='ebay.com'
)data = []
products = search_scraper.get_products()
for product in products:
product_scraper = EbayProduct(
link=product['link'],
reviews_limit=15,
multiplier=1
)product_data = product_scraper.get_product()
data.append(product_data)search_scraper.print(data)
search_scraper.save_to_json(data)
```### ✍Contributing
Feel free to open bug issue, something isn't working, what feature to add, or anything else.