Extract the string after title in BeautifulSoup
<p>html result is <code>&lt;div class="font-160 line-110" data-container=".snippet container" data-html="true" data-placement="top" data-template='&amp;lt;div class="tooltip infowin-tooltip" role="tooltip"&amp;gt;&amp;lt;div class="tooltip-arrow"&amp;gt;&amp;lt;div class="tooltip-arrow-inner"&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class="tooltip-inner" style="text-align: left"&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;' data-toggle="tooltip" title="XIAMEN [CN]"&gt;</code></p>

<p>How do I pull out <code>"XIAMEN [CN]"</code> right after <code>title</code>. I tried <code>find_all('title')</code> but that does not return a match. Nor can I call any from of <code>siblings</code> to traverse my way down the result. I couldn't even get <code>find(text='XIAMEN [CN]')</code> to return anything. </p>

<pre><code>from bs4 import BeautifulSoup

myHTML = 'what you posted above'
soup = BeautifulSoup(myHTML, "html5lib")
title = soup.find('div')['title']
</code></pre>

<p>We're just searching for <code>&lt;div&gt;</code> tags here, you'll probably want to be more specific in vivo.</p>

python html beautifulsoup