You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
meituan/run.py

12 lines
442 B

4 years ago
from config.log import writeInfo, writeError
4 years ago
from main import MeiTuanCrawler, MysqlDB
c = MeiTuanCrawler()
c.getCity()
4 years ago
option=input('选择爬虫选项:\n1.爬取所有城市\n2.爬取指定城市\n')
methods={'1':c.meishi,'2':c.meishiInputCity}
while option not in methods:
writeError('选项{}不合法!!!'.format(option))
option = input('选择爬虫选项:\n1.爬取所有城市\n2.爬取指定城市\n')
methods[option]()