Skip to content

Commit 807f437

Browse files
authored
Merge pull request #803 from nikhil25803/main
BBC changes
2 parents 8f31f07 + 4abc06b commit 807f437

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
__pycache__/
33
*.py[cod]
44
*$py.class
5+
<<<<<<< HEAD
6+
local_test.py
7+
=======
58
locaL_test.py
9+
>>>>>>> 8f31f07307b5d503598fb062f51376a7b9eac315
610
# C extensions
711
*.so
812
*.ipynb

src/scrape_up/bbcnews/bbcnews.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ def get_headlines(self):
2828
try:
2929
response = requests.get(self.headlines_url)
3030
response.raise_for_status() # Raise an exception for HTTP errors (4xx or 5xx)
31-
except requests.RequestException as e:
32-
print(f"Error fetching headlines: {e}")
33-
return []
31+
except:
32+
return None
3433

3534
soup = BeautifulSoup(response.content, "html.parser")
3635
headlines = soup.find_all("h3", class_="gs-c-promo-heading__title")

0 commit comments

Comments
 (0)