Created
March 30, 2020 03:12
-
-
Save ohidurbappy/225ffcb7dab3f85f37edbb2de8e23d2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from GoogleNews import GoogleNews | |
googlenews = GoogleNews() | |
# googlenews = GoogleNews('en','d') | |
q=input("Input a keyword to Search: ") | |
googlenews.search(q) | |
googlenews.getpage(1) | |
# googlenews.gettext() | |
# googlenews.getlinks() | |
print("Google News") | |
print("-"*65) | |
for result in googlenews.result(): | |
print(result['title']) | |
print(result['desc']) | |
print(result['link']) | |
print('-'*65) | |
for page in range(2,5): | |
googlenews.clear() | |
googlenews.getpage(page) | |
for result in googlenews.result(): | |
print(result['title']) | |
print(result['desc']) | |
print(result['link']) | |
print('-'*65) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment