Germey hace 8 años
padre
commit
86d63133fc
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 1 1
      proxypool/getter.py
  2. 1 1
      proxypool/scheduler.py

+ 1 - 1
proxypool/getter.py

@@ -22,7 +22,7 @@ class Getter():
     def run(self):
         print('获取器开始执行')
         proxy_count = 0
-        while not self.is_over_threshold():
+        if not self.is_over_threshold():
             for callback_label in range(self.crawler.__CrawlFuncCount__):
                 callback = self.crawler.__CrawlFunc__[callback_label]
                 # 获取代理

+ 1 - 1
proxypool/scheduler.py

@@ -30,9 +30,9 @@ class Scheduler():
         """
         定时获取代理
         """
+        getter = Getter()
         while True:
             print('开始抓取代理')
-            getter = Getter()
             getter.run()
             time.sleep(cycle)