From 73dab7cd26977bf43be37b37382a70edddb62f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanno=20B=C3=B6ck?= <990588+hannob@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:00:27 +0200 Subject: [PATCH] suppress warning when beautifulsoup parses an xml document as html --- snallygaster | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/snallygaster b/snallygaster index 128d555..cc06742 100755 --- a/snallygaster +++ b/snallygaster @@ -23,7 +23,7 @@ import dns.resolver import dns.query import dns.zone import urllib3 - +from bs4.builder import XMLParsedAsHTMLWarning STANDARD_PHP_FILES = ["index.php", "wp-config.php", "configuration.php", "config.php", "config.inc.php", "settings.php"] @@ -39,6 +39,8 @@ dns_cache = {} # content of a webpage looks suspicious, i.e. when it only # contains a single URL or a filename. warnings.filterwarnings("ignore", category=UserWarning, module="bs4") +# Disable warnings when BeautifulSoup sees an XML document +warnings.filterwarnings("ignore", category=XMLParsedAsHTMLWarning, module="html.parser") # This disables warnings about the lack of certificate verification. # Usually this is a bad idea, but for this tool we want to find HTTPS leaks