-
-
Save theawesomenayak/a9a5c9c3b812c3a7f96651dd67b240c8 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
def get_news_from_google(): | |
client = urlopen(news_url) | |
page = client.read() | |
client.close() | |
souped = soup(page, "xml") | |
news_list = souped.findAll("item") | |
result = [] | |
for news in news_list: | |
data = {} | |
data['title'] = news.title.text | |
data['date'] = news.pubDate.text | |
result.append(data) | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment