forked from awolfly9/IPProxyTool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runvalidator.py
42 lines (32 loc) · 1.1 KB
/
runvalidator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#-*- coding: utf-8 -*-
import logging
import os
import sys
import time
import scrapydo
import utils
from scrapy import cmdline
from scrapy.crawler import CrawlerProcess
from ipproxytool.spiders.validator.douban import DoubanSpider
from ipproxytool.spiders.validator.assetstore import AssetStoreSpider
from ipproxytool.spiders.validator.gather import GatherSpider
scrapydo.setup()
if __name__ == '__main__':
os.chdir(sys.path[0])
reload(sys)
sys.setdefaultencoding('utf-8')
if not os.path.exists('log'):
os.makedirs('log')
logging.basicConfig(
filename = 'log/validator.log',
format = '%(levelname)s %(asctime)s: %(message)s',
level = logging.DEBUG
)
utils.make_dir('log')
while True:
utils.log('----------------validator start...-----------------------')
items = scrapydo.run_spider(DoubanSpider)
# items = scrapydo.run_spider(GatherSpider)
# items = scrapydo.run_spider(AssetStoreSpider)
utils.log('*************************validator waiting...*************************')
time.sleep(60)