#new index.py # -*- coding: ISO-8859-1 -*- from lxml import etree from xml.dom.minidom import parseString # extract data from a xml file f = open('data.xml', 'r') f2 = open('data.xml', 'r') xml = etree.parse(f) data = f2.read() dom = parseString(data.encode('utf-8')) f.close() f2.close() n_hops = dom.getElementsByTagName('hop')[-1].toxml().replace('', '').replace('','').replace('','') asn = hop.getElementsByTagName('asn')[0].toxml().replace('','').replace('','') hop_ip = hop.getElementsByTagName('hop_ip')[0].toxml().replace('','').replace('','') longitude = hop.getElementsByTagName('longitude')[0].toxml().replace('','').replace('','') latitude = hop.getElementsByTagName('latitude')[0].toxml().replace('','').replace('','') point = """ L.marker(["""+latitude+""", """+longitude+"""]).addTo(map) .bindPopup(""""+server_name+"""
"""+hop_ip+"""
"""+asn+"""
").openPopup(); """ latlong = [float(latitude.encode('utf-8')), float(longitude.encode('utf-8'))] geoarray.append(latlong) hoplist.append(point) b = b+point test = open('test.html','w') output = """ Border Check - Web Visualizator
""" test.write(output) test.close