diff --git a/src/euscan/handlers/generic.py b/src/euscan/handlers/generic.py index 9d3910a..62304ec 100644 --- a/src/euscan/handlers/generic.py +++ b/src/euscan/handlers/generic.py @@ -8,14 +8,11 @@ import re import urllib.error import urllib.parse import urllib.request +import warnings from urllib.parse import urljoin, urlparse -try: - from BeautifulSoup import BeautifulSoup -except ImportError: - from bs4 import BeautifulSoup - import portage +from bs4 import BeautifulSoup, XMLParsedAsHTMLWarning from euscan import ( BRUTEFORCE_BLACKLIST_PACKAGES, @@ -65,6 +62,7 @@ def confidence_score(found, original, minimum=CONFIDENCE): def scan_html(data, url, pattern): + warnings.filterwarnings("ignore", category=XMLParsedAsHTMLWarning) soup = BeautifulSoup(data, features="lxml") results = []