Skip to content

Python Library to get/fetch news from google news

License

Notifications You must be signed in to change notification settings

roshaan55/pygnewslib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

pygnewslib

Python Library for getting/fetching news from google news.

Installation:

pip install pygnewslib

For Upgradation(pythmath):

pip install --upgrade pygnewslib

Usage:

from pygnewslib import GoogleNews

google_news = GoogleNews()
json_resp = google_news.fetch_news('Pakistan')
results = []
for ar in json_resp:
    results.append(ar["title"])

for i in range(len(results)):
    # printing all trending news
    print(i + 1, results[i])