12345678910111213141516171819202122232425262728293031 |
- # -*- coding: utf-8 -*-
- # Define your item pipelines here
- #
- # Don't forget to add your pipeline to the ITEM_PIPELINES setting
- # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
- import os
- class YdyspiderPipeline(object):
- def __init__(self, stats):
- self.__stats = stats
- def process_item(self, item, spider):
- return item
- @classmethod
- def from_crawler(cls, crawler):
- stats = crawler.stats
- return cls(
- stats=stats
- )
- def close_spider(self, spider):
- bid_list = self.__stats.get_value('bid_list')
- if bid_list is not None:
- for bid in bid_list:
- command = '/usr/local/php/bin/php /home/www/zhuishuyun_wap/artisan book:afs %s ' % bid
- os.system(command)
|