From 71186f3bece397ad9f979b0fa8d8b692c4cce4e6 Mon Sep 17 00:00:00 2001 From: zeek <984294471@qq.com> Date: Sun, 22 Mar 2020 11:56:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90sitemap.xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- get_url.py | 5 +++-- sitemap.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/get_url.py b/get_url.py index ab5ac5f..f91d237 100755 --- a/get_url.py +++ b/get_url.py @@ -7,7 +7,7 @@ from bs4 import BeautifulSoup url_root = 'https://git.zeekling.cn' url_mine_list = [ - 'https://git.zeekling.cn', + 'https://git.zeekling.cn/', 'https://git.zeekling.cn/zeekling' ] @@ -27,7 +27,8 @@ url_robot_arr = [ url_static_arr = [ '.js', '.css', - '.cscc' + '.cscc', + 'None' ] diff --git a/sitemap.py b/sitemap.py index 9dca82f..7e238c1 100755 --- a/sitemap.py +++ b/sitemap.py @@ -9,11 +9,11 @@ import get_url def create_xml(filename, url_list): header = '\n' - file = open(filename, 'a', encoding='utf-8') + file = open(filename, 'w', encoding='utf-8') file.writelines(header) file.close() + times = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S+00:00") for url in url_list: - times = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S+00:00") urls = re.sub(r"&", "&", url) ment = " \n %s\n %s\n weekly\n 0.8\n \n" % (urls, times) file = open(filename, 'a', encoding='utf-8')