Created
June 29, 2012 16:37
-
-
Save akyoto/3019059 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def findNodes(node, nodeName): | |
| callList = [] | |
| if node.nodeType == Node.ELEMENT_NODE and node.tagName == nodeName: | |
| callList.append(node) | |
| # TODO: Improve performance, make an iterative algorithm out of this: | |
| for child in node.childNodes: | |
| callList += findNodes(child, nodeName) | |
| return callList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment