python xml,beansdb

 

 

test

from dbclient import Beansdb
from xml.dom import minidom
import re
r = re.compile("http://\w*.duitang.com")

# three beansdb nodes on localhost
fs = Beansdb({"192.168.172.3:7700": range(16), "192.168.172.5:7700": range(16)}, 16)
b = minidom.parse('ip.xml')
for i in b.childNodes[0].getElementsByTagName('url'):
        url = i.childNodes[0].toxml()
        url = r.sub("media",url)
        print "%s %s"%(url,type(fs.get(url)))
 

test

 

 

 

 

你可能感兴趣的:(BeansDB)