Skip to content

Commit

Permalink
Merge pull request #803 from nikhil25803/main
Browse files Browse the repository at this point in the history
BBC changes
  • Loading branch information
nikhil25803 authored Oct 13, 2023
2 parents 8f31f07 + 4abc06b commit 807f437
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
__pycache__/
*.py[cod]
*$py.class
<<<<<<< HEAD
local_test.py
=======
locaL_test.py
>>>>>>> 8f31f07307b5d503598fb062f51376a7b9eac315
# C extensions
*.so
*.ipynb
Expand Down
5 changes: 2 additions & 3 deletions src/scrape_up/bbcnews/bbcnews.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ def get_headlines(self):
try:
response = requests.get(self.headlines_url)
response.raise_for_status() # Raise an exception for HTTP errors (4xx or 5xx)
except requests.RequestException as e:
print(f"Error fetching headlines: {e}")
return []
except:
return None

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

0 comments on commit 807f437

Please sign in to comment.