mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-20 23:16:49 +00:00
add args
This commit is contained in:
23
baidupush.py
23
baidupush.py
@@ -1,11 +1,18 @@
|
||||
import re
|
||||
import ssl
|
||||
import requests
|
||||
ssl._create_default_https_context = ssl._create_unverified_context
|
||||
url = 'https://www.ghlerrix.cn/sitemap.xml'
|
||||
result = requests.get(url)
|
||||
big = re.findall('<loc>(.*?)</loc>', result.content.decode('utf-8'), re.S)
|
||||
for i in big:
|
||||
print(i)
|
||||
# op_xml_txt = open('xml.txt', 'a')
|
||||
# op_xml_txt.write('%s\n' % i)
|
||||
import argparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ssl._create_default_https_context = ssl._create_unverified_context
|
||||
parser = argparse.ArgumentParser(description='parse sitemap')
|
||||
parser.add_argument('url', help='The url of your website')
|
||||
args = parser.parse_args()
|
||||
url = f'{args.url}/sitemap.xml'
|
||||
result = requests.get(url)
|
||||
big = re.findall('<loc>(.*?)</loc>', result.content.decode('utf-8'), re.S)
|
||||
for i in big:
|
||||
print(i)
|
||||
# op_xml_txt = open('xml.txt', 'a')
|
||||
# op_xml_txt.write('%s\n' % i)
|
||||
|
||||
Reference in New Issue
Block a user