我正在尝试调试一些继承的代码。所以有一行代码elt = doc.xpath('body/div/pre[@id="bb flags"]')[0]
我想查看整个文档的外观,而不只是一个特定的片段。那我应该在那插入什么xpath?即
elt_entire_document = doc.xpath(new xpath)
logging.info("The full document here is " + elt_entire_document.text)
xpath甚至可能做到这一点,还是比它更复杂?
根据我们的评论,就这样简单:
logging.info("The full document here is " + text)