fixed sinastock_spider issue

This commit is contained in:
marvzhang
2020-02-08 09:51:11 +08:00
parent 22b44d74fd
commit 4a62542eb1

View File

@@ -11,12 +11,6 @@ from sinastock.items import NewsItem
class SinastockSpiderSpider(scrapy.Spider):
name = 'sinastock_spider'
allowed_domains = ['finance.sina.com.cn']
mongo = MongoClient(
host=os.environ.get('MONGO_HOST') or 'localhost',
port=int(os.environ.get('MONGO_PORT') or 27017)
)
db = mongo[os.environ.get('MONGO_DB') or 'crawlab_test']
col = db.get_collection(os.environ.get('CRAWLAB_COLLECTION') or 'stock_news')
def start_requests(self):
col = self.db['stocks']