Your Name 6 anos atrás
pai
commit
56dfeba0b0
2 arquivos alterados com 4 adições e 6 exclusões
  1. 2 2
      hg3535/main.py
  2. 2 4
      hg3535/pipeline/lanqiu.py

+ 2 - 2
hg3535/main.py

@@ -6,13 +6,13 @@ from scrapy.cmdline import execute
 sys.path.append(os.path.dirname(os.path.abspath(__file__)))
 # execute(["scrapy", "crawl", "liansai"])
 # execute(["scrapy", "crawl", "zuqiu"])
-# execute(["scrapy", "crawl", "lanqiu"])
+execute(["scrapy", "crawl", "lanqiu"])
 # execute(["scrapy", "crawl", "guanjun"])
 # execute(["scrapy", "crawl", "wangqiu"])
 # execute(["scrapy", "crawl", "wqbodan"])
 # execute(["scrapy", "crawl", "bangqiu"])
 # execute(["scrapy", "crawl", "roll_zuqiu"]) # 滚球足球 回来要解开这个注释 其他全部解封
-execute(["scrapy", "crawl", "roll_lanqiu"]) #滚球篮球
+# execute(["scrapy", "crawl", "roll_lanqiu"]) #滚球篮球
 # execute(["scrapy", "crawl", "roll_wangqiu"]) #滚球网球
 # execute(["scrapy", "crawl", "roll_bangqiu"])  # 滚球棒球
 # execute(["scrapy", "crawl", "ball_status"]) #滚球id本地存

+ 2 - 4
hg3535/pipeline/lanqiu.py

@@ -3,8 +3,6 @@ import pymongo
 import time
 import logging
 from twisted.internet import defer, reactor
-
-import settings
 from .ball_func import fuhao
 
 from ..utils.helper import Helper
@@ -14,8 +12,8 @@ from ..settings import M_HOST, M_USER, M_PASSWORD, M_POST, M_DB, LEAGUE_URL, ODD
 
 class Lanqiupipeline(object):
     def open_spider(self, spider):
-        self.mongo = pymongo.MongoClient(host=settings.M_HOST, username=settings.M_USER, password=settings.M_PASSWORD, port=settings.M_POST)
-        self.db = self.mongo[settings.M_DB]
+        self.mongo = pymongo.MongoClient(host=M_HOST, username=M_USER, password=M_PASSWORD, port=M_POST)
+        self.db = self.mongo[M_DB]
 
     @defer.inlineCallbacks
     def process_item(self, item, spider):