【发布时间】:2014-02-22 21:48:58
【问题描述】:
我在 html 页面中有这段文字
<div class="phone-content">
050 2836142
</div>
我是这样提取的:
我正在使用 xpath 来提取该 div 中的值。
normalize-space(.//div[@class='fieldset-content']/span[@class='listing-reply-phone']/div[@class='phone-content']/text())
我得到了这个结果:
"\u202a050 2836142\u202a"
有人知道谁告诉 python 中的 xpath 删除那个 unicode 字符吗?
【问题讨论】:
-
如果只是数字,可以转成ASCII码。看到这个:stackoverflow.com/questions/1207457/…
标签: python python-2.7 xpath unicode