chorsley / python-Wappalyzer

Python driver for Wappalyzer, a web application detection utility.
GNU General Public License v3.0
309 stars 122 forks source link

how to disable annoying warning #39

Closed xash3000 closed 3 years ago

xash3000 commented 3 years ago

I keep getting this warning

/root/anaconda3/lib/python3.7/site-packages/Wappalyzer/Wappalyzer.py:228: UserWarning: Caught 'unbalanced parenthesis at position 119' compiling regex: ['(?:<div class="sf-toolbar[^>]+?>[^]+<span class="sf-toolbar-value">([\\d.])+|<div id="sfwdt[^"]+" class="[^"]*sf-toolbar)', 'version:\\1']

is there any way to disable warnings?

tristanlatr commented 3 years ago

Wappalyzer emits warnings when the regex are not valid for the re Python implementation.

This warning is emitted using the warnings lib.

Here https://github.com/chorsley/python-Wappalyzer/blob/master/Wappalyzer/Wappalyzer.py#L247

So you can do something like:

import warnings
warnings.filterwarnings("ignore", message="""Caught 'unbalanced parenthesis at position 119' compiling regex""", category=UserWarning )

That should do to trick