fix bugs and support all platform

This commit is contained in:
2025-08-15 08:33:47 +08:00
parent e82b85f4dd
commit 4945b4c6b0
36 changed files with 2296 additions and 992 deletions

View File

@@ -8,8 +8,8 @@ class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('--platform', type=str, default='all',
choices=['xuexi', 'central', 'provincial', 'all'],
help='选择爬取平台: xuexi(学习强国主站), central(中央媒体), provincial(省级平台), all(全部)')
choices=['xuexi', 'all'],
help='选择爬取平台: xuexi(学习强国主站), all(全部)')
def handle(self, *args, **options):
platform = options['platform']
@@ -22,18 +22,6 @@ class Command(BaseCommand):
'start_url': 'https://www.xuexi.cn',
'article_selector': 'a'
},
'central': {
'name': '学习强国中央媒体',
'base_url': 'https://www.xuexi.cn',
'start_url': 'https://www.xuexi.cn/central',
'article_selector': 'a'
},
'provincial': {
'name': '学习强国省级平台',
'base_url': 'https://www.xuexi.cn',
'start_url': 'https://www.xuexi.cn/provincial',
'article_selector': 'a'
}
}
if platform == 'all':