Skip to main content

A python package to scrape data from Ghana online shops

Project description

Python 3.7, 3.8, 3.9 Imports: isort

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

Click Here: 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"]
    • tv.png

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

Build

Credits

  • Theophilus Siameh
  • Follow me on Twitter
  • tsiameh twitter

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghanashops-scraper-0.0.11.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

ghanashops_scraper-0.0.11-py3-none-any.whl (11.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page