python - Spider 运行但不输出文件
问题描述
为蜘蛛编写了一个代码来搜索网站收集某些信息。蜘蛛运行但不输出所需文件夹中的信息。知道为什么会这样。请看下面的主要代码,我没有包含 URL 链接。
def parse(self, response):
prices = response.css('.price::text').extract()
titles = response.css('img::attr(alt)').extract()
images = response.css('img::attr(data-altimage)').extract()
for item in zip(titles, prices, images ):
scraped_info = {
'titles' :item[0],
'prices': item[1],
'images': item[2],
}
yield scraped_info
解决方案
推荐阅读
- reactjs - 主页中 laravel 的默认项目页面,而不是 React
- python - 到达错误页面:x 处的服务器响应时间过长
- excel - 如何通过表名引用excel中的列或在VBA宏中分配唯一ID?
- hdfs - PutHDFS 处理器无法写入已启用 kerberized 和 TLS/SSL 的 HDFS
- python - 特定区域中的python图像搜索(坐标)
- python - 在 Python 中使用 Outlook 时按类别进行限制
- android - 为什么不同设备的 ANativeWindow_Buffer.stride 不同
- r - R中列表中矩阵列表的减法
- sql - 需要在Oracle中添加字符串
- ruby-on-rails - 如何在 Rails 6 站点中实现 plyr.js?