File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -11,19 +11,19 @@ def news(xml_news_url):
1111 '''
1212
1313 context = ssl ._create_unverified_context ()
14- Client = urlopen (xml_news_url , context = context )
15- xml_page = Client .read ()
16- Client .close ()
14+ Client = urlopen (xml_news_url , context = context )
15+ xml_page = Client .read ()
16+ Client .close ()
1717
18- soup_page = soup (xml_page ,"xml" )
18+ soup_page = soup (xml_page ,"xml" )
1919
20- news_list = soup_page .findAll ("item" )
20+ news_list = soup_page .findAll ("item" )
2121
22- for news in news_list :
23- print (f'news title: { news .title .text } ' )
24- print (f'news link: { news .link .text } ' )
25- print (f'news pubDate: { news .pubDate .text } ' )
26- print ("+-" * 20 ,"\n \n " )
22+ for news in news_list :
23+ print (f'news title: { news .title .text } ' )
24+ print (f'news link: { news .link .text } ' )
25+ print (f'news pubDate: { news .pubDate .text } ' )
26+ print ("+-" * 20 ,"\n \n " )
2727
2828#you can add google news 'xml' URL here for any country/category
2929news_url = "https://news.google.com/news/rss/?ned=us&gl=US&hl=en"
You can’t perform that action at this time.
0 commit comments