# encoding:utf-8 import os import sys import time from utils import pubUtil pubUtil.timezone_is_cst() # 判断时区 CARRIER = 'wn' argv = sys.argv cmd = pubUtil.gen_cmd(CARRIER, argv) while True: os.system(cmd) time.sleep(8)
# encoding:utf-8 import sys, os, time from utils.pubUtil import timezone_is_cst timezone_is_cst() # 判断时区 CARRIER = 'dp' argv = sys.argv if len(argv) < 2: print('pls input like this:') print('python dp_spider.py lin 1 ') sys.exit() num = 1 if len(argv) < 3 else argv[2] # 爬虫序号 arg_set = set() # 生成后面的参数 arg_big = set() if len(argv) > 3: for arg in argv[3:]: if arg == '1': # 兼容以前的proxy版本的 arg_set.add('proxy=1') else: k, v = arg.split('=') if k == 'local': arg_big.add('CLOSESPIDER_TIMEOUT=0') if k.isupper(): arg_big.add(arg.replace(' ', '')) else: arg_set.add(arg.replace(' ', ''))
# encoding:utf-8 import sys, os, time from utils.pubUtil import timezone_is_cst timezone_is_cst() # 判断本地时区 argv = sys.argv host_name = argv[1] num = argv[2] if len(argv) > 2 else 1 proxy = argv[3] if len(argv) > 3 else '' while True: os.system('scrapy crawl mm -a host_name=%s -a num=%s -a proxy=%s' % (host_name, num, proxy)) time.sleep(8) # os.system('scrapy crawl mm -a host_name=%s -a num=%s -a proxy=%s' % (host_name, num, proxy))
from utils import pubUtil import sys, os, time pubUtil.timezone_is_cst() argv = sys.argv host_name = argv[1] num = argv[2] if len(argv) > 2 else 1 proxy = argv[3] if len(argv) > 3 else '' # host_name = 'hyn-test' # num = '1' # proxy='' while True: os.system('scrapy crawl jt -a host_name=%s -a num=%s' % (host_name, num)) time.sleep(8)