top of page

Searching News with scraparazzie

We teach and learn by making !


At Haruki Robotics Lab, we encourage students to build small projects that connect programming with the real world. In this exercise, we use Python to search and display recent news articles based on any keyword of interest.


ree


Python Code

Here’s a tiny program that asks for your city, connects to the internet, and shows you today’s weather:

from scraparazzie import scraparazzie as scrap

keyword = input("What do you wanna look up today? ")
numbers = input("Enter news numbers: ")
client = scrap.NewsClient(
    query=keyword,
    max_results=int(numbers)
    )
news = client.export_news()
for i in news:
  print(i['title'])
  print(i['source'])
  print(i['link'])
  print(i['publish_date'])
  print()

How it Works 🌍

  • Step 1: Ask the user which topic to search for.

  • Step 2: Specify how many news articles to fetch.

  • Step 3: Use scraparazzie to collect the results.

  • Step 4: Display each article’s title, source, link, and publish date.



Learning Goals

Students practice handling user input, understanding APIs and libraries, and working with structured data in Python. You can see how quickly learners move from theory to practical applications.


Next Steps

  • Filter results for local news only.

  • Store headlines in a text file for later reading.

  • Combine with the weather project for a daily news + forecast report.


At Haruki Robotics Lab, we teach and learn by making. Each small project strengthens skills and builds confidence in using technology to explore the world.

Comments


bottom of page