A python package to scrape data from GhanaWeb
Project description
GhanaWeb Scraper
A simple unofficial python package to scrape data from Ghanaweb. Affiliated to bank-of-ghana-fx-rates
How to install
pip install ghanaweb-scraper
Warning: DO NOT RUN IN ONLINE JUPYTERNOTEBOOKS eg. Colabs
Usage
# files will be download to your working directory
from ghanaweb.scraper import GhanaWeb
url = 'https://www.ghanaweb.com/GhanaHomePage/politics/'
# url = 'https://www.ghanaweb.com/GhanaHomePage/health/'
# url = 'https://www.ghanaweb.com/GhanaHomePage/crime/'
# url = 'https://www.ghanaweb.com/GhanaHomePage/regional/'
# url = 'https://www.ghanaweb.com/GhanaHomePage/year-in-review/'
# web = GhanaWeb(url='https://www.ghanaweb.com/GhanaHomePage/politics/')
web = GhanaWeb(url=url)
web.download()
scrape list of articles
from ghanaweb.scraper import GhanaWeb
urls = ['https://www.ghanaweb.com/GhanaHomePage/politics/',
'https://www.ghanaweb.com/GhanaHomePage/health/',
'https://www.ghanaweb.com/GhanaHomePage/crime/',
'https://www.ghanaweb.com/GhanaHomePage/regional/',
'https://www.ghanaweb.com/GhanaHomePage/year-in-review/'
]
for url in urls:
web = GhanaWeb(url=url)
web.download()
BuyMeCoffee
Credits
Theophilus Siameh
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
ghanaweb-scraper-1.0.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for ghanaweb_scraper-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa5fbaf9260d65e2b662f830b0245097a6c4553d0134b9c21d4358cd3e2349af |
|
MD5 | faba69829159f78f8c3ef0642d873ef4 |
|
BLAKE2b-256 | f7dd7960994ffe3187f1985e9ed4f4ebfd396b0f41de65112f1bb0e6f2fef1ec |