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, 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')
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 lefaso_net_scraper-0.2.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2942a78b144b43ba15a54f3f66f5381dee7f271e0c07aa1c19c5bff3a6dc5cb |
|
MD5 | 51fda50cb8c175da9a8c29e857d3c942 |
|
BLAKE2b-256 | 2d40cd7696f060b952d1f83a8e96889c0a457b9119edc039dcd9667a1fd26831 |