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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file ghanashops-scraper-0.0.11.tar.gz.

File metadata

  • Download URL: ghanashops-scraper-0.0.11.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for ghanashops-scraper-0.0.11.tar.gz
Algorithm Hash digest
SHA256 de8551fd0f1c07a2a360622cfd0eba9c7aa834d843a18efc11581db8f69d407a
MD5 51e4c580c1774802bd020a2a2157ec65
BLAKE2b-256 7939123328c30210be6ba1f41746ef9a831006d5df8ec480d5cce6e64e57ec31

See more details on using hashes here.

File details

Details for the file ghanashops_scraper-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for ghanashops_scraper-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 127caffa8ab9ffe76b2dadf33cd149b0305453d86bdc01452e35f66265fec14d
MD5 4ac0e156e5e4dd9e0411d94a45126295
BLAKE2b-256 12202867421305a28b016ef85e0589cd9b508400aecf37abaf5084c248db15e2

See more details on using hashes here.

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