思路 log->xml->csv
from bs4 import BeautifulSoup
import csv
# svn log -l 100 --xml > perfweb.xml
with open('D:\\perfweb.xml', encoding='UTF-8') as f_input:
soup = BeautifulSoup(f_input, "lxml")
with open('perweb.csv', 'w', newline='', encoding='UTF-8') as f_output:
csv_output = csv.writer(f_output)
csv_output.writerow(['author', 'date', 'msg'])
for tns in soup.find_all("logentry"):
csv_output.writerow(tns.find(entry).text for entry in ['author', 'date', 'msg'])