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

Class MinimalSoup

pattern/web/soup/BeautifulSoup.py:1662–1673  ·  view source on GitHub ↗

The MinimalSoup class is for parsing HTML that contains pathologically bad markup. It makes no assumptions about tag nesting, but it does know which tags are self-closing, that tags contain Javascript and should not be parsed, that META tags may contain encoding information,

Source from the content-addressed store, hash-verified

1660 I_CANT_BELIEVE_THEYRE_NESTABLE_INLINE_TAGS)
1661
1662class MinimalSoup(BeautifulSoup):
1663 """The MinimalSoup class is for parsing HTML that contains
1664 pathologically bad markup. It makes no assumptions about tag
1665 nesting, but it does know which tags are self-closing, that
1666 <script> tags contain Javascript and should not be parsed, that
1667 META tags may contain encoding information, and so on.
1668
1669 This also makes it better for subclassing than BeautifulStoneSoup
1670 or BeautifulSoup."""
1671
1672 RESET_NESTING_TAGS = buildTagMap('noscript')
1673 NESTABLE_TAGS = {}
1674
1675class BeautifulSOAP(BeautifulStoneSoup):
1676 """This class will push a tag with only a single string child into

Callers

nothing calls this directly

Calls 1

buildTagMapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…