Skip to content

Commit 8da6158

Browse files
Merge pull request #451 from cclauss/patch-1
Fix IndentationError: unexpected indent
2 parents 0829862 + f4faa2f commit 8da6158

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Google_News.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff 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
2929
news_url="https://news.google.com/news/rss/?ned=us&gl=US&hl=en"

0 commit comments

Comments
 (0)