From 70550b528b51e5923eb472078c2b83be7595b6cc Mon Sep 17 00:00:00 2001 From: Abhishek Kainth Date: Fri, 14 Jul 2023 01:59:39 +0530 Subject: [PATCH] Avoid a call without proxy when scraping_bee is provided --- pygooglenews/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pygooglenews/__init__.py b/pygooglenews/__init__.py index 244c927..d3f34e2 100644 --- a/pygooglenews/__init__.py +++ b/pygooglenews/__init__.py @@ -63,15 +63,11 @@ def __parse_feed(self, feed_url, proxies=None, scraping_bee = None): if proxies: r = requests.get(feed_url, proxies = proxies) - else: - r = requests.get(feed_url) - - if scraping_bee: + elif scraping_bee: r = self.__scaping_bee_request(url = feed_url, api_key = scraping_bee) else: r = requests.get(feed_url) - if 'https://news.google.com/rss/unsupported' in r.url: raise Exception('This feed is not available')