Pulling specific string with lxml?
<p>I have the html: </p>

<pre><code>&lt;div title="" data-toggle="tooltip" data-template="
&lt;div class=&amp;quot;tooltip infowin-tooltip&amp;quot; role=&amp;quot;tooltip&amp;quot;&gt;
&lt;div class=&amp;quot;tooltip-arrow&amp;quot;&gt;
&lt;div class=&amp;quot;tooltip-arrow-inner&amp;quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&amp;quot;tooltip-inner&amp;quot; style=&amp;quot;text-align: left&amp;quot;&gt;
&lt;/div&gt;
&lt;/div&gt;"
 data-html="true" data-placement="top" data-container=".snippet-container" class="font-160 line-110 text-default text-light" data-original-title="HOUSTON [US]"&gt;
&lt;ahref="/en/ais/details/ports/919" class="no-underline group-ib color-inherit"&gt;USHOU&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>I want to pull "HOUSTON [US]" from it using <code>lxml</code>. With <code>BeautifulSoup</code> I could do </p>

<p><code>soup.find("div", class_='font-160 line-110')["title"]</code> </p>

<p>is there anything similar in <code>lxml</code>? I tried </p>

<pre><code>parsed_body.xpath('.//div[@class="font-160 line-110 text-default text-light")["title"]')[0].text 
</code></pre>

<p>But this returns blank. </p>

<p>I ended up using <code>//div/@title[0]</code> which pulls the desired text.</p>

python python-3.x lxml