Posted in Python onMarch 30, 2014
# _*_ coding:utf-8 _*_ #xiaohei.python.seo.call.me:) #win+python2.7.x id_ = 1 f = open('clubpop%s.xml' % id_, 'w') for i, line in enumerate(open('suk.csv')): if i % 50000==0: print i f.write('<?xml version="1.0" encoding="UTF-8"?>\n<urlset>\n') f.write(''' <url> <loc>https://3water.com/review/%s-1-1.html</loc> </url> ''' % line.rstrip()) if i % 50000==49999: f.write('</urlset>') f.close() id_ += 1 f = open('clubpop%s.xml' % id_, 'w') f.write('</urlset>') f.close()
ptyhon实现sitemap生成示例
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@