test action and parse

This commit is contained in:
Ghlerrix
2023-08-07 14:51:20 +08:00
parent 70cc96d8f1
commit 770382afb5
2 changed files with 40 additions and 0 deletions

11
baidupush.py Normal file
View File

@@ -0,0 +1,11 @@
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)