Avoid to display the UserWarning message of bs4 library
<p>Every time I make soup a sourcecode of a page with bs4 in python, the terminal shows:</p>

<pre><code>/usr/local/lib/python3.4/dist-packages/bs4/__init__.py:181: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html5lib"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 229 of the file HibernetBlock.py. To get rid of this warning, change code that looks like this:

 BeautifulSoup([your markup])

to this:

 BeautifulSoup([your markup], "html5lib")

  markup_type=markup_type))
</code></pre>

<p>Is there a way to avoid to display this?</p>

<p>While the inclusion of the parser is optional, the warning is telling you that results may vary from system to system if you don't explicitly state which parser you want to use.</p>

<p>The <a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser" rel="nofollow">documentation</a> makes it clear that there are advantages and disadvantages to each parser. If you let the module choose "best available" on the system, you may use <code>html5lib</code> on one system and <code>html.parser</code> on another. The two could parse a page differently. This warning is telling you that is a possibility.</p>

<p><a href="http://i.stack.imgur.com/R4p28.png" rel="nofollow"><img src="http://i.stack.imgur.com/R4p28.png" alt="BS Parsers"></a>
<sup>Click for larger view from documentation</sup></p>

<p>To fix your warning, and ensure that all system are parsing the same way, <a href="https://www.python.org/dev/peps/pep-0020/" rel="nofollow">explicitly</a> set the parser you want to use:</p>

<pre><code>BeautifulSoup(html, "html5lib")
</code></pre>

<p>And remember:</p>

<blockquote>
  <p>Explicit is better than implicit.</p>
</blockquote>

python python-3.x beautifulsoup warnings bs4