【文件属性】:
文件名称:python提取xml里面的链接源码详解
文件大小:39KB
文件格式:PDF
更新时间:2020-12-26 11:29:00
data python python函数
因群里朋友需要提取xml地图里面的链接,就写了这个程序。
代码:
#coding=utf-8
import urllib
import urllib.request
import re\nurl='http://zhimo.yuanzhumuban.cc/sitemaps.xml'
html=urllib.request.urlopen(url).read()
html=html.decode('utf-8')
r=re.compile(r'(http://zhimo.yuanzhumuban.cc.*?\.html)')
big=re.findall(r,html)
for i in big