【发布时间】:2018-04-04 16:26:17
【问题描述】:
是否可以将抓取项目的结果插入到 html 代码中?如何实现?
类似这样的:
for ntp in response.css('div.content-1col-nobox'):
description = ntp.xpath('normalize-space(//div[6]/div[1]/div[2]/div/blockquote[2]/p/text())').extract_first()
'Description': '<html><body>......'description'..............</body></html>',\
提前谢谢你。
【问题讨论】:
-
是的,这是可能的,我建议您在正则表达式中记录自己以及它们如何帮助您将描述字符串放置在 html 代码的所需位置
-
谢谢@ClementLombard 我会做的