Add download media
This commit is contained in:
0
core/management/commands/__init__.py
Normal file
0
core/management/commands/__init__.py
Normal file
@@ -6,7 +6,6 @@ class Command(BaseCommand):
|
||||
help = '爬取新华网文章示例'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
# 假设你事先在后台建了“新华网”这个Website实例
|
||||
website_name = "新华网"
|
||||
try:
|
||||
website = Website.objects.get(name=website_name)
|
||||
@@ -14,7 +13,6 @@ class Command(BaseCommand):
|
||||
self.stdout.write(self.style.ERROR(f"网站 '{website_name}' 不存在,请先后台创建"))
|
||||
return
|
||||
|
||||
# 这里写你想爬取的文章URL列表,可以循环多篇
|
||||
urls = [
|
||||
"https://www.news.cn/legal/20250721/f340f7be3d5b4b938cbd6b9889b6fbdc/c.html",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user