123456789101112131415161718192021222324252627 |
- import codecs
- from bs4 import BeautifulSoup
- with codecs.open('c:/tmp/sitemap.xml', 'r','utf-8') as f:
- data = f.read()
- bs_data = BeautifulSoup(data, 'xml')
- b_unique = bs_data.find_all('url')
- cnt=0
- for el in b_unique:
- loc=el.find('loc')
- print(loc.text)
|