GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aisyyhf/kompas-news-scraper: Python scraper that collects Kompas news articles for a date range into a CSV dataset.

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
README.md
README.md
 
 
webscrapping.py
webscrapping.py
 
 

Repository files navigation

Kompas News Scraper

A Python script that scrapes news articles from Kompas for a date range and saves them to a CSV file.

For each article, it collects the title, publish time, full text, tags, author, and URL. It goes through every page of the Kompas index for each date.

How to run

pip install requests beautifulsoup4 lxml
python webscrapping.py

By default it scrapes January 2024 and saves the results to kompas_articles_2024.csv. To change the dates, edit start_date and end_date in scrape_articles_for_year.

What I learned

  • Sending HTTP requests and parsing HTML with BeautifulSoup
  • Handling pagination and missing elements on real web pages
  • Saving scraped data into a structured CSV dataset

The script depends on the current HTML structure of the Kompas website, so some selectors may need updating if the site changes.

About

Python scraper that collects Kompas news articles for a date range into a CSV dataset.

Topics

beautifulsoupdatasetnewspythonweb-scraping

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.