Commit
•
4aab4a6
1
Parent(s):
4d0f06f
Update news_extractor/news_extractor.py
Browse files
news_extractor/news_extractor.py
CHANGED
@@ -65,6 +65,8 @@ def src_parse(rss):
|
|
65 |
rss = 'ndtv profit'
|
66 |
if rss.find('ndtv') >= 0:
|
67 |
rss = 'ndtv.com'
|
|
|
|
|
68 |
|
69 |
rss = rss.replace("https://www.", "")
|
70 |
rss = rss.split("/")
|
@@ -87,7 +89,7 @@ def news_agg(rss):
|
|
87 |
'cache-control': 'max-age=0',
|
88 |
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'
|
89 |
}
|
90 |
-
resp = r.get(rss, timeout=
|
91 |
logging.warning(f'{rss}: {resp.status_code}')
|
92 |
b = BeautifulSoup(resp.content, "xml")
|
93 |
items = b.find_all("item")
|
|
|
65 |
rss = 'ndtv profit'
|
66 |
if rss.find('ndtv') >= 0:
|
67 |
rss = 'ndtv.com'
|
68 |
+
if rss.find('telanganatoday') >= 0:
|
69 |
+
rss = 'telanganatoday.com'
|
70 |
|
71 |
rss = rss.replace("https://www.", "")
|
72 |
rss = rss.split("/")
|
|
|
89 |
'cache-control': 'max-age=0',
|
90 |
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'
|
91 |
}
|
92 |
+
resp = r.get(rss, timeout=5, headers=headers)
|
93 |
logging.warning(f'{rss}: {resp.status_code}')
|
94 |
b = BeautifulSoup(resp.content, "xml")
|
95 |
items = b.find_all("item")
|