def frames(self): """an array of all the frames (including iframes) in the current window""" from thug.DOM.W3C.HTML.HTMLCollection import HTMLCollection frames = set() for frame in self._findAll(['frame', 'iframe']): if not getattr(frame, '_node', None): from thug.DOM.W3C.Core.DOMImplementation import DOMImplementation DOMImplementation.createHTMLElement(self.window.doc, frame) frames.add(frame._node) return HTMLCollection(self.doc, list(frames))
def frames(self): """an array of all the frames (including iframes) in the current window""" from thug.DOM.W3C.HTML.HTMLCollection import HTMLCollection for frame in self._findAll(['frame', 'iframe']): code = unicode(frame) if code in self._inner_frames: continue self._inner_frames.add(code) self._frames.add(Window(self.url, w3c.parseString(code), personality = log.ThugOpts.useragent)) return HTMLCollection(self.doc, list(self._frames))