python – Xpath normalize-space
我感到愚蠢. Python& xpath新手在这里.我正在尝试使用xpath从中提取完整文本’Open Box Price:$1079.99′
<div class="prod-price">
<p class="opbox-price">
<strong> Open Box Price:<br>$1079.99</strong>
</p>
<p class="orig-price">
Regular Price: <strong>$1499.98</strong>
</p>
</div>
但我不能.文字在< br>处停止.这是我的代码
doc = lxml.html.fromstring(r.content)
elements = doc.xpath(item_xpath)
print elements[1].find('div[3]/p[1]/text()[normalize-space()]')