title: How to solve this namespace conflict with BeautifulSoup?
body: <p>I'm having some trouble with Python namespaces. </p>
  
  <p>With <code>import bs4</code></p>
  
  <pre><code>&gt;&gt;&gt; import bs4
  &gt;&gt;&gt; print type(x)
  &gt;&gt;&gt; &lt;class 'bs4.element.NavigableString'&gt;
  &gt;&gt;&gt; isinstance(x,bs4.element.NavigableString)
  &gt;&gt;&gt; True
  </code></pre>
  
  <p>But I want to use <code>from bs4 import BeautifulSoup</code> and then I get an error</p>
  
  <pre><code>&gt;&gt;&gt; from bs4 import BeautifulSoup
  &gt;&gt;&gt; print type(x)
  &gt;&gt;&gt; &lt;class 'bs4.element.NavigableString'&gt;
  &gt;&gt;&gt; isinstance(x,bs4.element.NavigableString)
  &gt;&gt;&gt; ...
  NameError: name 'bs4' is not defined
  
  
  isinstance(x,bs4.element.NavigableString)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
               What should go here? 
  </code></pre>
  
  <p>Checked also <a href="https://stackoverflow.com/questions/21819763/isinstance-not-working-correctly-with-beautifulsoupnameerror">isinstance not working correctly with beautifulsoup(NameError)</a> but it didn't help me.</p>