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=['zgfnb', 'mobile', 'all'],
help='选择爬取平台: zgfnb(中国妇女报), mobile(移动端), all(全部)')
choices=['zgfnb', 'all'],
help='选择爬取平台: zgfnb(中国妇女报), all(全部)')
def handle(self, *args, **options):
platform = options['platform']
@@ -22,12 +22,7 @@ class Command(BaseCommand):
'start_url': 'http://www.cnwomen.com.cn',
'article_selector': 'a'
},
'mobile': {
'name': '中国妇女报移动端',
'base_url': 'http://m.cnwomen.com.cn',
'start_url': 'http://m.cnwomen.com.cn',
'article_selector': 'a'
}
}
if platform == 'all':