We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b18c4f8 + 209bf82 commit a5089caCopy full SHA for a5089ca
Google_News.py
@@ -4,7 +4,9 @@
4
from urllib.request import urlopen
5
6
def news(xml_news_url):
7
-
+ '''Print select details from a html response containing xml
8
+ @param xml_news_url: url to parse
9
+ '''
10
Client=urlopen(xml_news_url)
11
xml_page=Client.read()
12
Client.close()
@@ -15,10 +17,10 @@ def news(xml_news_url):
15
17
16
18
for news in news_list:
19
- print(news.title.text)
- print(news.link.text)
20
- print(news.pubDate.text)
21
- print("\n\n")
+ print(f'news title: {news.title.text}')
+ print(f'news link: {news.link.text}')
22
+ print(f'news pubDate: {news.pubDate.text}')
23
+ print("+-"*20,"\n\n")
24
25
26
0 commit comments