from BeautifulSoup import BeautifulSouppage = BeautifulSoup('<foo bar="asdf" blah="123">xyz</foo>')for attr, value in page.find('foo').attrs: print attr, "=", value# Prints:# bar = asdf# blah = 123
欢迎分享,转载请注明来源:内存溢出
from BeautifulSoup import BeautifulSouppage = BeautifulSoup('<foo bar="asdf" blah="123">xyz</foo>')for attr, value in page.find('foo').attrs: print attr, "=", value# Prints:# bar = asdf# blah = 123
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)