【发布时间】:2016-05-10 16:34:44
【问题描述】:
试图打印出从 lxml 检索到的整个元素。
from lxml import html
import requests
page=requests.get("http://finance.yahoo.com/q?s=INTC")
qtree = html.fromstring(page.content)
quote = qtree.xpath('//span[@class="time_rtq_ticker"]')
print 'Shares outstanding', Shares
print 'Quote', quote
我得到的输出是
Quote [<Element span at 0x1044db788>]
但我想打印出该元素以进行故障排除。
【问题讨论】: