Skip to content

Commit

Permalink
fix: avoid BeautifulSoup warning
Browse files Browse the repository at this point in the history
  • Loading branch information
vzhd1701 committed May 11, 2022
1 parent 9560172 commit 5ebb85d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions enex2notion/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import logging
import sys
import warnings
from pathlib import Path
from typing import Optional

Expand Down Expand Up @@ -296,3 +297,11 @@ def _setup_logging(is_verbose: bool, log_file: Optional[Path]):
logging.getLogger("enex2notion").addHandler(file_handler)

logging.getLogger("urllib3").setLevel(logging.ERROR)

# For latest version of BeautifulSoup
try:
from bs4 import XMLParsedAsHTMLWarning

warnings.filterwarnings("ignore", category=XMLParsedAsHTMLWarning)
except ImportError:
pass
1 change: 1 addition & 0 deletions enex2notion/note_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def parse_note(


def _parse_note_dom(note: EvernoteNote):
# Using html.parser because Evernote enml2 is basically HTML
note_dom = BeautifulSoup(note.content, "html.parser").find("en-note")

if not note_dom:
Expand Down

0 comments on commit 5ebb85d

Please sign in to comment.