PageRenderTime 41ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/public_html/apidocs/pymine.beautifulsoup.BeautifulSoup.html

http://pymine.googlecode.com/
HTML | 285 lines | 198 code | 87 blank | 0 comment | 0 complexity | 3c41824f53c257653825649eb3bd4256 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.1
  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "DTD/xhtml1-strict.dtd">
  4. <html>
  5. <head>
  6. <title>API docs for &ldquo;pymine.beautifulsoup.BeautifulSoup&rdquo;</title>
  7. <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
  8. <link href="apidocs.css" type="text/css" rel="stylesheet" />
  9. </head>
  10. <body>
  11. <h1 class="module">Module p.b.BeautifulSoup</h1>
  12. <p>
  13. <span id="part">Part of <a href="pymine.html">pymine</a>.<a href="pymine.beautifulsoup.html">beautifulsoup</a></span>
  14. </p>
  15. <div>
  16. </div>
  17. <pre>Beautiful Soup
  18. Elixir and Tonic
  19. "The Screen-Scraper's Friend"
  20. http://www.crummy.com/software/BeautifulSoup/
  21. Beautiful Soup parses a (possibly invalid) XML or HTML document into a
  22. tree representation. It provides methods and Pythonic idioms that make
  23. it easy to navigate, search, and modify the tree.
  24. A well-formed XML/HTML document yields a well-formed data
  25. structure. An ill-formed XML/HTML document yields a correspondingly
  26. ill-formed data structure. If your document is only locally
  27. well-formed, you can use this library to find and process the
  28. well-formed part of it.
  29. Beautiful Soup works with Python 2.2 and up. It has no external
  30. dependencies, but you'll have more success at converting data to UTF-8
  31. if you also install these three packages:
  32. * chardet, for auto-detecting character encodings
  33. http://chardet.feedparser.org/
  34. * cjkcodecs and iconv_codec, which add more encodings to the ones supported
  35. by stock Python.
  36. http://cjkpython.i18n.org/
  37. Beautiful Soup defines classes for two main parsing strategies:
  38. * BeautifulStoneSoup, for parsing XML, SGML, or your domain-specific
  39. language that kind of looks like XML.
  40. * BeautifulSoup, for parsing run-of-the-mill HTML code, be it valid
  41. or invalid. This class has web browser-like heuristics for
  42. obtaining a sensible parse tree in the face of common HTML errors.
  43. Beautiful Soup also defines a class (UnicodeDammit) for autodetecting
  44. the encoding of an HTML or XML document, and converting it to
  45. Unicode. Much of this code is taken from Mark Pilgrim's Universal Feed Parser.
  46. For more than you ever wanted to know about Beautiful Soup, see the
  47. documentation:
  48. http://www.crummy.com/software/BeautifulSoup/documentation.html
  49. Here, have some legalese:
  50. Copyright (c) 2004-2009, Leonard Richardson
  51. All rights reserved.
  52. Redistribution and use in source and binary forms, with or without
  53. modification, are permitted provided that the following conditions are
  54. met:
  55. * Redistributions of source code must retain the above copyright
  56. notice, this list of conditions and the following disclaimer.
  57. * Redistributions in binary form must reproduce the above
  58. copyright notice, this list of conditions and the following
  59. disclaimer in the documentation and/or other materials provided
  60. with the distribution.
  61. * Neither the name of the the Beautiful Soup Consortium and All
  62. Night Kosher Bakery nor the names of its contributors may be
  63. used to endorse or promote products derived from this software
  64. without specific prior written permission.
  65. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  66. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  67. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  68. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  69. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  70. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  71. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  72. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  73. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  74. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  75. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE, DAMMIT.</pre>
  76. <div id="splitTables">
  77. <table class="children sortable" id="id44">
  78. <tr class="function">
  79. <td>Function</td>
  80. <td><a href="pymine.beautifulsoup.BeautifulSoup.html#_match_css_class">_match_css_class</a></td>
  81. <td><span>Build a RE to match the given CSS class.</span></td>
  82. </tr><tr class="class">
  83. <td>Class</td>
  84. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html">PageElement</a></td>
  85. <td><span>Contains the navigational information for some part of the page</span></td>
  86. </tr><tr class="class">
  87. <td>Class</td>
  88. <td><a href="pymine.beautifulsoup.BeautifulSoup.NavigableString.html">NavigableString</a></td>
  89. <td><span class="undocumented">No class docstring; 2/5 methods documented</span></td>
  90. </tr><tr class="class">
  91. <td>Class</td>
  92. <td><a href="pymine.beautifulsoup.BeautifulSoup.CData.html">CData</a></td>
  93. <td><span class="undocumented">Undocumented</span></td>
  94. </tr><tr class="class">
  95. <td>Class</td>
  96. <td><a href="pymine.beautifulsoup.BeautifulSoup.ProcessingInstruction.html">ProcessingInstruction</a></td>
  97. <td><span class="undocumented">Undocumented</span></td>
  98. </tr><tr class="class">
  99. <td>Class</td>
  100. <td><a href="pymine.beautifulsoup.BeautifulSoup.Comment.html">Comment</a></td>
  101. <td><span class="undocumented">Undocumented</span></td>
  102. </tr><tr class="class">
  103. <td>Class</td>
  104. <td><a href="pymine.beautifulsoup.BeautifulSoup.Declaration.html">Declaration</a></td>
  105. <td><span class="undocumented">Undocumented</span></td>
  106. </tr><tr class="class">
  107. <td>Class</td>
  108. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html">Tag</a></td>
  109. <td><span>Represents a found HTML tag with its attributes and contents.</span></td>
  110. </tr><tr class="class">
  111. <td>Class</td>
  112. <td><a href="pymine.beautifulsoup.BeautifulSoup.SoupStrainer.html">SoupStrainer</a></td>
  113. <td><span>Encapsulates a number of ways of matching a markup element (tag or</span></td>
  114. </tr><tr class="class">
  115. <td>Class</td>
  116. <td><a href="pymine.beautifulsoup.BeautifulSoup.ResultSet.html">ResultSet</a></td>
  117. <td><span>A ResultSet is just a list that keeps track of the SoupStrainer</span></td>
  118. </tr><tr class="function">
  119. <td>Function</td>
  120. <td><a href="pymine.beautifulsoup.BeautifulSoup.html#buildTagMap">buildTagMap</a></td>
  121. <td><span>Turns a list of maps, lists, or scalars into a single map.</span></td>
  122. </tr><tr class="class">
  123. <td>Class</td>
  124. <td><a href="pymine.beautifulsoup.BeautifulSoup.BeautifulStoneSoup.html">BeautifulStoneSoup</a></td>
  125. <td><span>This class contains the basic parser and search code. It defines</span></td>
  126. </tr><tr class="class">
  127. <td>Class</td>
  128. <td><a href="pymine.beautifulsoup.BeautifulSoup.BeautifulSoup.html">BeautifulSoup</a></td>
  129. <td><span>This parser knows the following facts about HTML:</span></td>
  130. </tr><tr class="class">
  131. <td>Class</td>
  132. <td><a href="pymine.beautifulsoup.BeautifulSoup.StopParsing.html">StopParsing</a></td>
  133. <td><span class="undocumented">Undocumented</span></td>
  134. </tr><tr class="class">
  135. <td>Class</td>
  136. <td><a href="pymine.beautifulsoup.BeautifulSoup.ICantBelieveItsBeautifulSoup.html">ICantBelieveItsBeautifulSoup</a></td>
  137. <td><span>The BeautifulSoup class is oriented towards skipping over</span></td>
  138. </tr><tr class="class">
  139. <td>Class</td>
  140. <td><a href="pymine.beautifulsoup.BeautifulSoup.MinimalSoup.html">MinimalSoup</a></td>
  141. <td><span>The MinimalSoup class is for parsing HTML that contains</span></td>
  142. </tr><tr class="class">
  143. <td>Class</td>
  144. <td><a href="pymine.beautifulsoup.BeautifulSoup.BeautifulSOAP.html">BeautifulSOAP</a></td>
  145. <td><span>This class will push a tag with only a single string child into</span></td>
  146. </tr><tr class="class">
  147. <td>Class</td>
  148. <td><a href="pymine.beautifulsoup.BeautifulSoup.RobustXMLParser.html">RobustXMLParser</a></td>
  149. <td><span class="undocumented">Undocumented</span></td>
  150. </tr><tr class="class">
  151. <td>Class</td>
  152. <td><a href="pymine.beautifulsoup.BeautifulSoup.RobustHTMLParser.html">RobustHTMLParser</a></td>
  153. <td><span class="undocumented">Undocumented</span></td>
  154. </tr><tr class="class">
  155. <td>Class</td>
  156. <td><a href="pymine.beautifulsoup.BeautifulSoup.RobustWackAssHTMLParser.html">RobustWackAssHTMLParser</a></td>
  157. <td><span class="undocumented">Undocumented</span></td>
  158. </tr><tr class="class">
  159. <td>Class</td>
  160. <td><a href="pymine.beautifulsoup.BeautifulSoup.RobustInsanelyWackAssHTMLParser.html">RobustInsanelyWackAssHTMLParser</a></td>
  161. <td><span class="undocumented">Undocumented</span></td>
  162. </tr><tr class="class">
  163. <td>Class</td>
  164. <td><a href="pymine.beautifulsoup.BeautifulSoup.SimplifyingSOAPParser.html">SimplifyingSOAPParser</a></td>
  165. <td><span class="undocumented">Undocumented</span></td>
  166. </tr><tr class="class">
  167. <td>Class</td>
  168. <td><a href="pymine.beautifulsoup.BeautifulSoup.UnicodeDammit.html">UnicodeDammit</a></td>
  169. <td><span>A class for detecting the encoding of a *ML document and</span></td>
  170. </tr>
  171. </table>
  172. </div>
  173. <div class="function">
  174. <a name="pymine.beautifulsoup.BeautifulSoup._match_css_class"></a>
  175. <a name="_match_css_class"></a>
  176. <div class="functionHeader">
  177. def _match_css_class(str):
  178. </div>
  179. <div class="functionBody">
  180. <div>Build a RE to match the given CSS class.<table class="fieldTable"></table></div>
  181. </div>
  182. </div><div class="function">
  183. <a name="pymine.beautifulsoup.BeautifulSoup.buildTagMap"></a>
  184. <a name="buildTagMap"></a>
  185. <div class="functionHeader">
  186. def buildTagMap(default, *args):
  187. </div>
  188. <div class="functionBody">
  189. <div>Turns a list of maps, lists, or scalars into a single map. Used to build
  190. the SELF_CLOSING_TAGS, NESTABLE_TAGS, and NESTING_RESET_TAGS maps out of
  191. lists and partial maps.<table class="fieldTable"></table></div>
  192. </div>
  193. </div>
  194. <address>
  195. <a href="index.html">API Documentation</a> for pymine, generated by <a href="http://codespeak.net/~mwh/pydoctor/">pydoctor</a> at 2010-04-07 23:15:24.
  196. </address>
  197. </body>
  198. </html>