A python package to scrape data from Ghana online shops
Project description
Ghana Online Shops Scraper
A simple unofficial python package to scrape data from Tonaton, JumiaGH. Affiliated to Bank of Ghana Fx Rates GhanaNews-Scraper.
How to install
pip install ghanashops-scraper
Example Google Colab Notebook
Outputs
- All outputs will be saved in a
.csv
file. Other file formats not yet supported. - Format:
- ["product_description", "price", "location", "photo", "page_url"]
Usage
- Scrape shop data from Tonaton
- Example of search queries: cars, laptops, phones, vehicles, rent, houses, tablets, shoes, refrigerator
from tonaton.scraper import Tonaton
search_query = "iphones"
tonaton = Tonaton(query=search_query)
tonaton.download()
Limiting the number of pages to scrape.
- Note: some pages may take longer depending on the count. Recommend
limiting
your pages.
from tonaton.scraper import Tonaton
search_query = "laptops"
tonaton = Tonaton(query=search_query, limit_pages=10)
tonaton.download()
Using Asyncio
- DO NOT USE IN JUPYTER NOTEBOOKS OR GOOGLE COLAB. OTHER WAYS ARE ACCEPTED
import asyncio
from tonaton.scrapy import Tonaton
search_query = "buses"
tonaton = Tonaton(query=search_query, limit_pages=10)
if __name__ == '__main__':
asyncio.run(tonaton.get_data())
tonaton.download()
BuyMeCoffee
Credits
Theophilus Siameh
- Follow me on Twitter
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
Close
Hashes for ghanashops-scraper-0.0.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | de8551fd0f1c07a2a360622cfd0eba9c7aa834d843a18efc11581db8f69d407a |
|
MD5 | 51e4c580c1774802bd020a2a2157ec65 |
|
BLAKE2b-256 | 7939123328c30210be6ba1f41746ef9a831006d5df8ec480d5cce6e64e57ec31 |
Close
Hashes for ghanashops_scraper-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 127caffa8ab9ffe76b2dadf33cd149b0305453d86bdc01452e35f66265fec14d |
|
MD5 | 4ac0e156e5e4dd9e0411d94a45126295 |
|
BLAKE2b-256 | 12202867421305a28b016ef85e0589cd9b508400aecf37abaf5084c248db15e2 |