def __init__(self, name = None, **kwargs):
super(JDItemInfoSpider, self).__init__(name, **kwargs)
self.url = kwargs.get("url")
self.guid = kwargs.get('guid', 'guid')
self.product_id = kwargs.get('product_id')
# self.url = 'https://item.jd.com/11478178241.html'
# self.url = 'https://item.jd.com/4142680.html'
# self.url = 'https://item.jd.com/3133859.html'
# self.url = 'https://item.jd.com/3995645.html'
# self.product_id = 3995645
self.log('product_id:%s' % self.product_id)
self.item_table = 'item_%s' % self.product_id
self.urls_key = '%s_urls' % self.product_id
self.log_dir = 'log/%s' % self.product_id
self.is_record_page = False
self.sql = kwargs.get('sql')
self.red = kwargs.get('red')
if self.is_record_page:
utils.make_dir(self.log_dir)
评论列表
文章目录