Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 490 Bytes

README.md

File metadata and controls

27 lines (22 loc) · 490 Bytes

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])