The ultimate library for data scientist to scrape data from https://www.lefaso.net
Project description
lefaso-net-scraper
Description
lefaso-net-scraper is a robust and versatile Python library designed to efficiently extract articles from the popular online news source of of Burkina Faso, www.lefaso.net. This powerful scraping tool allows users to effortlessly collect article content and data from Internet users’ comments on lefaso.net.
Data Format
| Field | Description |
|---|---|
| article_topic | article topic |
| article_title | article title |
| article_published_date | article published date |
| article_origin | article origin |
| article_url | article url |
| article_content | article content |
| article_comments | article comments |
Installation
- With poetry
poetry add lefaso-net-scraper
- With pip
pip install lefaso-net-scraper
Usage
# coding: utf-8
from lefaso_net_scraper import LefasoNetScraper
section_url = 'https://lefaso.net/spip.php?rubrique473'
scraper = LefasoNetScraper(section_url)
data = scraper.run()
Settings Pagination range
# coding: utf-8
from lefaso_net_scraper import LefasoNetScraper
section_url = 'https://lefaso.net/spip.php?rubrique473'
scraper = LefasoNetScraper(section_url)
scraper.set_pagination_range(start=20, stop=100)
data = scraper.run()
Save data to csv
# coding: utf-8
from lefaso_net_scraper import LefasoNetScraper
import pandas as pd
section_url = 'https://lefaso.net/spip.php?rubrique473'
scraper = LefasoNetScraper(section_url)
data = scraper.run()
df = pd.DataFrame.from_records(data)
df.to_csv('path/to/df.csv')
Support this project and others !
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lefaso_net_scraper-0.3.0.tar.gz.
File metadata
- Download URL: lefaso_net_scraper-0.3.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-1012-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ae57e9eaa43e05a5ab082f5a50f93626c4ac39ca79bf53a7cbde298c6621935
|
|
| MD5 |
602a93aaad4faea763ed92f2c8279e9c
|
|
| BLAKE2b-256 |
ca6c746c0bb3753d6239cfa347abc31c43a59d9cc8a653516c75479928cdb33f
|
File details
Details for the file lefaso_net_scraper-0.3.0-py3-none-any.whl.
File metadata
- Download URL: lefaso_net_scraper-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-1012-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3fd2140465210892fb8cb127a4bce5be48e3a1d748446d4a4cf6bcee2cf98bb
|
|
| MD5 |
6c641f4a48da9fe0ff776112a9490ad2
|
|
| BLAKE2b-256 |
431157c31d4f87b9632686ada00af7069514ee6e8efd8d6d46df5c851b633d63
|