Skip to content

Commit

Permalink
Catching warnings within context manager
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaz committed Feb 21, 2024
1 parent f84b10c commit 1763785
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions minet/scrape/classes/named/europresse.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

from .types import NamedScraper

warnings.filterwarnings("ignore", category=MarkupResemblesLocatorWarning)


def extract_content(content):
return BeautifulSoup(unescape(content), "html.parser").get_text().strip()
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=MarkupResemblesLocatorWarning)
return BeautifulSoup(unescape(content), "html.parser").get_text().strip()


def extract_date(doc_id):
Expand Down

0 comments on commit 1763785

Please sign in to comment.