MCPcopy Create free account
hub / github.com/clips/pattern / getText

Method getText

pattern/web/soup/BeautifulSoup.py:576–586  ·  view source on GitHub ↗
(self, separator=u"")

Source from the content-addressed store, hash-verified

574 string = property(getString, setString)
575
576 def getText(self, separator=u""):
577 if not len(self.contents):
578 return u""
579 stopNode = self._lastRecursiveChild().next
580 strings = []
581 current = self.contents[0]
582 while current is not stopNode:
583 if isinstance(current, NavigableString):
584 strings.append(current.strip())
585 current = current.next
586 return separator.join(strings)
587
588 text = property(getText)
589

Callers 1

testTextMethod · 0.80

Calls 4

lenFunction · 0.85
_lastRecursiveChildMethod · 0.80
stripMethod · 0.80
appendMethod · 0.45

Tested by 1

testTextMethod · 0.64