擅长:python、mysql、java
<p>您需要搜索<code>→</code>的unicode表示形式:</p>
<pre><code>>>> s = u"→"
>>> s
u'\u2192'
>>> import lxml.html
>>>
>>> my_string = "<li>I have a dream &#8594; Hello!</li>"
>>> elem = lxml.html.fromstring(my_string)
>>>
>>> if u'\u2192' in elem.text:
... print("bar")
...
bar
</code></pre>