擅长:python、mysql、java
<p>指定<code>with_tail=False</code>将删除尾部文本。在</p>
<pre><code>print(etree.tostring(element, encoding="unicode", pretty_print=True, with_tail=False))
</code></pre>
<p>见<a href="http://lxml.de/api/lxml.etree-module.html#tostring" rel="nofollow">^{<cd2>} documentation</a>。在</p>