def getText(nodelist):
"""Extracts the text between XML tags
I took this directly from http://docs.python.org/library/xml.dom.minidom.html.
For example, if I have a tag <Tag>525</Tag> this method returns me '525'
"""
rc = ""
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc = rc + node.data
return rc
खड़ी कर रहा है मुझे IndentationError: unindent does not match any outer indentation level
(अजगर) docstring खरोज त्रुटि
def getText(nodelist):
rc = ""
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc = rc + node.data
return rc
देता है नहीं करता है। मैं जो कर रहा हूं वह डॉकस्ट्रिंग टिप्पणी को हटा रहा है। क्या हो रहा है?
ध्यान दें कि यह आमतौर पर करने के लिए तेज़ है: आरसी = [], rc.append (node.data), वापसी '' .join (आरसी)। ऐसा इसलिए है क्योंकि आपको हर बार एक नई स्ट्रिंग बनाने की आवश्यकता नहीं है। – EOL
'रिटर्न' '.join (n.node n nnelTist = n ntteT_nx = n nnelTepe == n.TEXT_NODE)' –