PageRenderTime 54ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://pymine.googlecode.com/
HTML | 866 lines | 619 code | 247 blank | 0 comment | 0 complexity | d99088a7f00fa0af270b6380460728a4 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.Tag&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="class">Class p.b.B.Tag(<a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html">PageElement</a>):</h1>
  12. <p>
  13. <span id="part">Part of <a href="pymine.html">pymine</a>.<a href="pymine.beautifulsoup.html">beautifulsoup</a>.<a href="pymine.beautifulsoup.BeautifulSoup.html">BeautifulSoup</a></span>
  14. <a href="classIndex.html#pymine.beautifulsoup.BeautifulSoup.Tag">View In Hierarchy</a>
  15. </p>
  16. <div>
  17. <p>Known subclasses: <a href="pymine.beautifulsoup.BeautifulSoup.BeautifulStoneSoup.html">pymine.beautifulsoup.BeautifulSoup.BeautifulStoneSoup</a></p>
  18. </div>
  19. <div>Represents a found HTML tag with its attributes and contents.<table class="fieldTable"></table></div>
  20. <div id="splitTables">
  21. <table class="children sortable" id="id60">
  22. <tr class="method">
  23. <td>Method</td>
  24. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#_invert">_invert</a></td>
  25. <td><span>Cheap function to invert a hash.</span></td>
  26. </tr><tr class="method">
  27. <td>Method</td>
  28. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#_convertEntities">_convertEntities</a></td>
  29. <td><span>Used in a call to re.sub to replace HTML, XML, and numeric</span></td>
  30. </tr><tr class="method">
  31. <td>Method</td>
  32. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__init__">__init__</a></td>
  33. <td><span>Basic constructor.</span></td>
  34. </tr><tr class="method">
  35. <td>Method</td>
  36. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#getString">getString</a></td>
  37. <td><span class="undocumented">Undocumented</span></td>
  38. </tr><tr class="method">
  39. <td>Method</td>
  40. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#setString">setString</a></td>
  41. <td><span>Replace the contents of the tag with a string</span></td>
  42. </tr><tr class="method">
  43. <td>Method</td>
  44. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#getText">getText</a></td>
  45. <td><span class="undocumented">Undocumented</span></td>
  46. </tr><tr class="method">
  47. <td>Method</td>
  48. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#get">get</a></td>
  49. <td><span>Returns the value of the 'key' attribute for the tag, or</span></td>
  50. </tr><tr class="method">
  51. <td>Method</td>
  52. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#clear">clear</a></td>
  53. <td><span>Extract all children.</span></td>
  54. </tr><tr class="method">
  55. <td>Method</td>
  56. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#index">index</a></td>
  57. <td><span class="undocumented">Undocumented</span></td>
  58. </tr><tr class="method">
  59. <td>Method</td>
  60. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#has_key">has_key</a></td>
  61. <td><span class="undocumented">Undocumented</span></td>
  62. </tr><tr class="method">
  63. <td>Method</td>
  64. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__getitem__">__getitem__</a></td>
  65. <td><span>tag[key] returns the value of the 'key' attribute for the tag,</span></td>
  66. </tr><tr class="method">
  67. <td>Method</td>
  68. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__iter__">__iter__</a></td>
  69. <td><span>Iterating over a tag iterates over its contents.</span></td>
  70. </tr><tr class="method">
  71. <td>Method</td>
  72. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__len__">__len__</a></td>
  73. <td><span>The length of a tag is the length of its list of contents.</span></td>
  74. </tr><tr class="method">
  75. <td>Method</td>
  76. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__contains__">__contains__</a></td>
  77. <td><span class="undocumented">Undocumented</span></td>
  78. </tr><tr class="method">
  79. <td>Method</td>
  80. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__nonzero__">__nonzero__</a></td>
  81. <td><span>A tag is non-None even if it has no contents.</span></td>
  82. </tr><tr class="method">
  83. <td>Method</td>
  84. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__setitem__">__setitem__</a></td>
  85. <td><span>Setting tag[key] sets the value of the 'key' attribute for the</span></td>
  86. </tr><tr class="method">
  87. <td>Method</td>
  88. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__delitem__">__delitem__</a></td>
  89. <td><span>Deleting tag[key] deletes all 'key' attributes for the tag.</span></td>
  90. </tr><tr class="method">
  91. <td>Method</td>
  92. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__call__">__call__</a></td>
  93. <td><span>Calling a tag like a function is the same as calling its</span></td>
  94. </tr><tr class="method">
  95. <td>Method</td>
  96. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__getattr__">__getattr__</a></td>
  97. <td><span class="undocumented">Undocumented</span></td>
  98. </tr><tr class="method">
  99. <td>Method</td>
  100. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__eq__">__eq__</a></td>
  101. <td><span>Returns true iff this tag has the same name, the same attributes,</span></td>
  102. </tr><tr class="method">
  103. <td>Method</td>
  104. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__ne__">__ne__</a></td>
  105. <td><span>Returns true iff this tag is not identical to the other tag,</span></td>
  106. </tr><tr class="method">
  107. <td>Method</td>
  108. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__repr__">__repr__</a></td>
  109. <td><span>Renders this tag as a string.</span></td>
  110. </tr><tr class="method">
  111. <td>Method</td>
  112. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__unicode__">__unicode__</a></td>
  113. <td><span class="undocumented">Undocumented</span></td>
  114. </tr><tr class="method">
  115. <td>Method</td>
  116. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#_sub_entity">_sub_entity</a></td>
  117. <td><span>Used with a regular expression to substitute the</span></td>
  118. </tr><tr class="method">
  119. <td>Method</td>
  120. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#__str__">__str__</a></td>
  121. <td><span>Returns a string or Unicode representation of this tag and</span></td>
  122. </tr><tr class="method">
  123. <td>Method</td>
  124. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#decompose">decompose</a></td>
  125. <td><span>Recursively destroys the contents of this tree.</span></td>
  126. </tr><tr class="method">
  127. <td>Method</td>
  128. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#prettify">prettify</a></td>
  129. <td><span class="undocumented">Undocumented</span></td>
  130. </tr><tr class="method">
  131. <td>Method</td>
  132. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#renderContents">renderContents</a></td>
  133. <td><span>Renders the contents of this tag as a string in the given</span></td>
  134. </tr><tr class="method">
  135. <td>Method</td>
  136. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#find">find</a></td>
  137. <td><span>Return only the first child of this Tag matching the given</span></td>
  138. </tr><tr class="method">
  139. <td>Method</td>
  140. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#findAll">findAll</a></td>
  141. <td><span>Extracts a list of Tag objects that match the given</span></td>
  142. </tr><tr class="method">
  143. <td>Method</td>
  144. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#fetchText">fetchText</a></td>
  145. <td><span class="undocumented">Undocumented</span></td>
  146. </tr><tr class="method">
  147. <td>Method</td>
  148. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#firstText">firstText</a></td>
  149. <td><span class="undocumented">Undocumented</span></td>
  150. </tr><tr class="method">
  151. <td>Method</td>
  152. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#_getAttrMap">_getAttrMap</a></td>
  153. <td><span>Initializes a map representation of this tag's attributes,</span></td>
  154. </tr><tr class="method">
  155. <td>Method</td>
  156. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#childGenerator">childGenerator</a></td>
  157. <td><span class="undocumented">Undocumented</span></td>
  158. </tr><tr class="method">
  159. <td>Method</td>
  160. <td><a href="pymine.beautifulsoup.BeautifulSoup.Tag.html#recursiveChildGenerator">recursiveChildGenerator</a></td>
  161. <td><span class="undocumented">Undocumented</span></td>
  162. </tr>
  163. </table>
  164. <p>
  165. Inherited from <a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html">PageElement</a>:
  166. </p>
  167. <table class="children sortable" id="id61">
  168. <tr class="basemethod">
  169. <td>Method</td>
  170. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#setup">setup</a></td>
  171. <td><span>Sets up the initial relations between this element and</span></td>
  172. </tr><tr class="basemethod">
  173. <td>Method</td>
  174. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#replaceWith">replaceWith</a></td>
  175. <td><span class="undocumented">Undocumented</span></td>
  176. </tr><tr class="basemethod">
  177. <td>Method</td>
  178. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#replaceWithChildren">replaceWithChildren</a></td>
  179. <td><span class="undocumented">Undocumented</span></td>
  180. </tr><tr class="basemethod">
  181. <td>Method</td>
  182. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#extract">extract</a></td>
  183. <td><span>Destructively rips this element out of the tree.</span></td>
  184. </tr><tr class="basemethod">
  185. <td>Method</td>
  186. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#_lastRecursiveChild">_lastRecursiveChild</a></td>
  187. <td><span>Finds the last element beneath this object to be parsed.</span></td>
  188. </tr><tr class="basemethod">
  189. <td>Method</td>
  190. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#insert">insert</a></td>
  191. <td><span class="undocumented">Undocumented</span></td>
  192. </tr><tr class="basemethod">
  193. <td>Method</td>
  194. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#append">append</a></td>
  195. <td><span>Appends the given tag to the contents of this tag.</span></td>
  196. </tr><tr class="basemethod">
  197. <td>Method</td>
  198. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#findNext">findNext</a></td>
  199. <td><span>Returns the first item that matches the given criteria and</span></td>
  200. </tr><tr class="basemethod">
  201. <td>Method</td>
  202. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#findAllNext">findAllNext</a></td>
  203. <td><span>Returns all items that match the given criteria and appear</span></td>
  204. </tr><tr class="basemethod">
  205. <td>Method</td>
  206. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#findNextSibling">findNextSibling</a></td>
  207. <td><span>Returns the closest sibling to this Tag that matches the</span></td>
  208. </tr><tr class="basemethod">
  209. <td>Method</td>
  210. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#findNextSiblings">findNextSiblings</a></td>
  211. <td><span>Returns the siblings of this Tag that match the given</span></td>
  212. </tr><tr class="basemethod">
  213. <td>Method</td>
  214. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#findPrevious">findPrevious</a></td>
  215. <td><span>Returns the first item that matches the given criteria and</span></td>
  216. </tr><tr class="basemethod">
  217. <td>Method</td>
  218. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#findAllPrevious">findAllPrevious</a></td>
  219. <td><span>Returns all items that match the given criteria and appear</span></td>
  220. </tr><tr class="basemethod">
  221. <td>Method</td>
  222. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#findPreviousSibling">findPreviousSibling</a></td>
  223. <td><span>Returns the closest sibling to this Tag that matches the</span></td>
  224. </tr><tr class="basemethod">
  225. <td>Method</td>
  226. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#findPreviousSiblings">findPreviousSiblings</a></td>
  227. <td><span>Returns the siblings of this Tag that match the given</span></td>
  228. </tr><tr class="basemethod">
  229. <td>Method</td>
  230. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#findParent">findParent</a></td>
  231. <td><span>Returns the closest parent of this Tag that matches the given</span></td>
  232. </tr><tr class="basemethod">
  233. <td>Method</td>
  234. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#findParents">findParents</a></td>
  235. <td><span>Returns the parents of this Tag that match the given</span></td>
  236. </tr><tr class="basemethod">
  237. <td>Method</td>
  238. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#_findOne">_findOne</a></td>
  239. <td><span class="undocumented">Undocumented</span></td>
  240. </tr><tr class="basemethod">
  241. <td>Method</td>
  242. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#_findAll">_findAll</a></td>
  243. <td><span>Iterates over a generator looking for things that match.</span></td>
  244. </tr><tr class="basemethod">
  245. <td>Method</td>
  246. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#nextGenerator">nextGenerator</a></td>
  247. <td><span class="undocumented">Undocumented</span></td>
  248. </tr><tr class="basemethod">
  249. <td>Method</td>
  250. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#nextSiblingGenerator">nextSiblingGenerator</a></td>
  251. <td><span class="undocumented">Undocumented</span></td>
  252. </tr><tr class="basemethod">
  253. <td>Method</td>
  254. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#previousGenerator">previousGenerator</a></td>
  255. <td><span class="undocumented">Undocumented</span></td>
  256. </tr><tr class="basemethod">
  257. <td>Method</td>
  258. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#previousSiblingGenerator">previousSiblingGenerator</a></td>
  259. <td><span class="undocumented">Undocumented</span></td>
  260. </tr><tr class="basemethod">
  261. <td>Method</td>
  262. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#parentGenerator">parentGenerator</a></td>
  263. <td><span class="undocumented">Undocumented</span></td>
  264. </tr><tr class="basemethod">
  265. <td>Method</td>
  266. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#substituteEncoding">substituteEncoding</a></td>
  267. <td><span class="undocumented">Undocumented</span></td>
  268. </tr><tr class="basemethod">
  269. <td>Method</td>
  270. <td><a href="pymine.beautifulsoup.BeautifulSoup.PageElement.html#toEncoding">toEncoding</a></td>
  271. <td><span>Encodes an object to a string in some encoding, or to Unicode.</span></td>
  272. </tr>
  273. </table>
  274. </div>
  275. <div class="function">
  276. <a name="pymine.beautifulsoup.BeautifulSoup.Tag._invert"></a>
  277. <a name="_invert"></a>
  278. <div class="functionHeader">
  279. def _invert(h):
  280. </div>
  281. <div class="functionBody">
  282. <div>Cheap function to invert a hash.<table class="fieldTable"></table></div>
  283. </div>
  284. </div><div class="function">
  285. <a name="pymine.beautifulsoup.BeautifulSoup.Tag._convertEntities"></a>
  286. <a name="_convertEntities"></a>
  287. <div class="functionHeader">
  288. def _convertEntities(self, match):
  289. </div>
  290. <div class="functionBody">
  291. <div>Used in a call to re.sub to replace HTML, XML, and numeric entities with
  292. the appropriate Unicode characters. If HTML entities are being converted,
  293. any unrecognized entities are escaped.<table class="fieldTable"></table></div>
  294. </div>
  295. </div><div class="function">
  296. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__init__"></a>
  297. <a name="__init__"></a>
  298. <div class="functionHeader">
  299. def __init__(self, parser, name, attrs=None, parent=None, previous=None):
  300. </div>
  301. <div class="functionBody">
  302. <div class="interfaceinfo">overridden in <a href="pymine.beautifulsoup.BeautifulSoup.BeautifulStoneSoup.html">pymine.beautifulsoup.BeautifulSoup.BeautifulStoneSoup</a></div>
  303. <div>Basic constructor.<table class="fieldTable"></table></div>
  304. </div>
  305. </div><div class="function">
  306. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.getString"></a>
  307. <a name="getString"></a>
  308. <div class="functionHeader">
  309. def getString(self):
  310. </div>
  311. <div class="functionBody">
  312. <div class="undocumented">Undocumented</div>
  313. </div>
  314. </div><div class="function">
  315. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.setString"></a>
  316. <a name="setString"></a>
  317. <div class="functionHeader">
  318. def setString(self, string):
  319. </div>
  320. <div class="functionBody">
  321. <div>Replace the contents of the tag with a string<table class="fieldTable"></table></div>
  322. </div>
  323. </div><div class="function">
  324. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.getText"></a>
  325. <a name="getText"></a>
  326. <div class="functionHeader">
  327. def getText(self, separator=u''):
  328. </div>
  329. <div class="functionBody">
  330. <div class="undocumented">Undocumented</div>
  331. </div>
  332. </div><div class="function">
  333. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.get"></a>
  334. <a name="get"></a>
  335. <div class="functionHeader">
  336. def get(self, key, default=None):
  337. </div>
  338. <div class="functionBody">
  339. <div>Returns the value of the 'key' attribute for the tag, or the value given
  340. for 'default' if it doesn't have that attribute.<table class="fieldTable"></table></div>
  341. </div>
  342. </div><div class="function">
  343. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.clear"></a>
  344. <a name="clear"></a>
  345. <div class="functionHeader">
  346. def clear(self):
  347. </div>
  348. <div class="functionBody">
  349. <div>Extract all children.<table class="fieldTable"></table></div>
  350. </div>
  351. </div><div class="function">
  352. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.index"></a>
  353. <a name="index"></a>
  354. <div class="functionHeader">
  355. def index(self, element):
  356. </div>
  357. <div class="functionBody">
  358. <div class="undocumented">Undocumented</div>
  359. </div>
  360. </div><div class="function">
  361. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.has_key"></a>
  362. <a name="has_key"></a>
  363. <div class="functionHeader">
  364. def has_key(self, key):
  365. </div>
  366. <div class="functionBody">
  367. <div class="undocumented">Undocumented</div>
  368. </div>
  369. </div><div class="function">
  370. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__getitem__"></a>
  371. <a name="__getitem__"></a>
  372. <div class="functionHeader">
  373. def __getitem__(self, key):
  374. </div>
  375. <div class="functionBody">
  376. <div>tag[key] returns the value of the 'key' attribute for the tag, and
  377. throws an exception if it's not there.<table class="fieldTable"></table></div>
  378. </div>
  379. </div><div class="function">
  380. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__iter__"></a>
  381. <a name="__iter__"></a>
  382. <div class="functionHeader">
  383. def __iter__(self):
  384. </div>
  385. <div class="functionBody">
  386. <div>Iterating over a tag iterates over its contents.<table class="fieldTable"></table></div>
  387. </div>
  388. </div><div class="function">
  389. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__len__"></a>
  390. <a name="__len__"></a>
  391. <div class="functionHeader">
  392. def __len__(self):
  393. </div>
  394. <div class="functionBody">
  395. <div>The length of a tag is the length of its list of contents.<table class="fieldTable"></table></div>
  396. </div>
  397. </div><div class="function">
  398. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__contains__"></a>
  399. <a name="__contains__"></a>
  400. <div class="functionHeader">
  401. def __contains__(self, x):
  402. </div>
  403. <div class="functionBody">
  404. <div class="undocumented">Undocumented</div>
  405. </div>
  406. </div><div class="function">
  407. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__nonzero__"></a>
  408. <a name="__nonzero__"></a>
  409. <div class="functionHeader">
  410. def __nonzero__(self):
  411. </div>
  412. <div class="functionBody">
  413. <div>A tag is non-None even if it has no contents.<table class="fieldTable"></table></div>
  414. </div>
  415. </div><div class="function">
  416. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__setitem__"></a>
  417. <a name="__setitem__"></a>
  418. <div class="functionHeader">
  419. def __setitem__(self, key, value):
  420. </div>
  421. <div class="functionBody">
  422. <div>Setting tag[key] sets the value of the 'key' attribute for the tag.<table class="fieldTable"></table></div>
  423. </div>
  424. </div><div class="function">
  425. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__delitem__"></a>
  426. <a name="__delitem__"></a>
  427. <div class="functionHeader">
  428. def __delitem__(self, key):
  429. </div>
  430. <div class="functionBody">
  431. <div>Deleting tag[key] deletes all 'key' attributes for the tag.<table class="fieldTable"></table></div>
  432. </div>
  433. </div><div class="function">
  434. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__call__"></a>
  435. <a name="__call__"></a>
  436. <div class="functionHeader">
  437. def __call__(self, *args, **kwargs):
  438. </div>
  439. <div class="functionBody">
  440. <div>Calling a tag like a function is the same as calling its findAll()
  441. method. Eg. tag('a') returns a list of all the A tags found within this
  442. tag.<table class="fieldTable"></table></div>
  443. </div>
  444. </div><div class="function">
  445. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__getattr__"></a>
  446. <a name="__getattr__"></a>
  447. <div class="functionHeader">
  448. def __getattr__(self, tag):
  449. </div>
  450. <div class="functionBody">
  451. <div class="interfaceinfo">overridden in <a href="pymine.beautifulsoup.BeautifulSoup.BeautifulStoneSoup.html">pymine.beautifulsoup.BeautifulSoup.BeautifulStoneSoup</a></div>
  452. <div class="undocumented">Undocumented</div>
  453. </div>
  454. </div><div class="function">
  455. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__eq__"></a>
  456. <a name="__eq__"></a>
  457. <div class="functionHeader">
  458. def __eq__(self, other):
  459. </div>
  460. <div class="functionBody">
  461. <div>Returns true iff this tag has the same name, the same attributes, and
  462. the same contents (recursively) as the given tag.</p>
  463. <p>NOTE: right now this will return false if two tags have the same
  464. attributes in a different order. Should this be fixed?<table class="fieldTable"></table></div>
  465. </div>
  466. </div><div class="function">
  467. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__ne__"></a>
  468. <a name="__ne__"></a>
  469. <div class="functionHeader">
  470. def __ne__(self, other):
  471. </div>
  472. <div class="functionBody">
  473. <div>Returns true iff this tag is not identical to the other tag, as defined
  474. in __eq__.<table class="fieldTable"></table></div>
  475. </div>
  476. </div><div class="function">
  477. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__repr__"></a>
  478. <a name="__repr__"></a>
  479. <div class="functionHeader">
  480. def __repr__(self, encoding=DEFAULT_OUTPUT_ENCODING):
  481. </div>
  482. <div class="functionBody">
  483. <div>Renders this tag as a string.<table class="fieldTable"></table></div>
  484. </div>
  485. </div><div class="function">
  486. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__unicode__"></a>
  487. <a name="__unicode__"></a>
  488. <div class="functionHeader">
  489. def __unicode__(self):
  490. </div>
  491. <div class="functionBody">
  492. <div class="undocumented">Undocumented</div>
  493. </div>
  494. </div><div class="function">
  495. <a name="pymine.beautifulsoup.BeautifulSoup.Tag._sub_entity"></a>
  496. <a name="_sub_entity"></a>
  497. <div class="functionHeader">
  498. def _sub_entity(self, x):
  499. </div>
  500. <div class="functionBody">
  501. <div>Used with a regular expression to substitute the appropriate XML entity
  502. for an XML special character.<table class="fieldTable"></table></div>
  503. </div>
  504. </div><div class="function">
  505. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.__str__"></a>
  506. <a name="__str__"></a>
  507. <div class="functionHeader">
  508. def __str__(self, encoding=DEFAULT_OUTPUT_ENCODING, prettyPrint=False, indentLevel=0):
  509. </div>
  510. <div class="functionBody">
  511. <div>Returns a string or Unicode representation of this tag and its contents.
  512. To get Unicode, pass None for encoding.</p>
  513. <p>NOTE: since Python's HTML parser consumes whitespace, this method is not
  514. certain to reproduce the whitespace present in the original string.<table class="fieldTable"></table></div>
  515. </div>
  516. </div><div class="function">
  517. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.decompose"></a>
  518. <a name="decompose"></a>
  519. <div class="functionHeader">
  520. def decompose(self):
  521. </div>
  522. <div class="functionBody">
  523. <div>Recursively destroys the contents of this tree.<table class="fieldTable"></table></div>
  524. </div>
  525. </div><div class="function">
  526. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.prettify"></a>
  527. <a name="prettify"></a>
  528. <div class="functionHeader">
  529. def prettify(self, encoding=DEFAULT_OUTPUT_ENCODING):
  530. </div>
  531. <div class="functionBody">
  532. <div class="undocumented">Undocumented</div>
  533. </div>
  534. </div><div class="function">
  535. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.renderContents"></a>
  536. <a name="renderContents"></a>
  537. <div class="functionHeader">
  538. def renderContents(self, encoding=DEFAULT_OUTPUT_ENCODING, prettyPrint=False, indentLevel=0):
  539. </div>
  540. <div class="functionBody">
  541. <div>Renders the contents of this tag as a string in the given encoding. If
  542. encoding is None, returns a Unicode string..<table class="fieldTable"></table></div>
  543. </div>
  544. </div><div class="function">
  545. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.find"></a>
  546. <a name="find"></a>
  547. <div class="functionHeader">
  548. def find(self, name=None, attrs={}, recursive=True, text=None, **kwargs):
  549. </div>
  550. <div class="functionBody">
  551. <div>Return only the first child of this Tag matching the given criteria.<table class="fieldTable"></table></div>
  552. </div>
  553. </div><div class="function">
  554. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.findAll"></a>
  555. <a name="findAll"></a>
  556. <div class="functionHeader">
  557. def findAll(self, name=None, attrs={}, recursive=True, text=None, limit=None, **kwargs):
  558. </div>
  559. <div class="functionBody">
  560. <div>Extracts a list of Tag objects that match the given criteria. You can
  561. specify the name of the Tag and any attributes you want the Tag to
  562. have.</p>
  563. <p>The value of a key-value pair in the 'attrs' map can be a string, a list
  564. of strings, a regular expression object, or a callable that takes a string
  565. and returns whether or not the string matches for some custom definition of
  566. 'matches'. The same is true of the tag name.<table class="fieldTable"></table></div>
  567. </div>
  568. </div><div class="function">
  569. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.fetchText"></a>
  570. <a name="fetchText"></a>
  571. <div class="functionHeader">
  572. def fetchText(self, text=None, recursive=True, limit=None):
  573. </div>
  574. <div class="functionBody">
  575. <div class="undocumented">Undocumented</div>
  576. </div>
  577. </div><div class="function">
  578. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.firstText"></a>
  579. <a name="firstText"></a>
  580. <div class="functionHeader">
  581. def firstText(self, text=None, recursive=True):
  582. </div>
  583. <div class="functionBody">
  584. <div class="undocumented">Undocumented</div>
  585. </div>
  586. </div><div class="function">
  587. <a name="pymine.beautifulsoup.BeautifulSoup.Tag._getAttrMap"></a>
  588. <a name="_getAttrMap"></a>
  589. <div class="functionHeader">
  590. def _getAttrMap(self):
  591. </div>
  592. <div class="functionBody">
  593. <div>Initializes a map representation of this tag's attributes, if not
  594. already initialized.<table class="fieldTable"></table></div>
  595. </div>
  596. </div><div class="function">
  597. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.childGenerator"></a>
  598. <a name="childGenerator"></a>
  599. <div class="functionHeader">
  600. def childGenerator(self):
  601. </div>
  602. <div class="functionBody">
  603. <div class="undocumented">Undocumented</div>
  604. </div>
  605. </div><div class="function">
  606. <a name="pymine.beautifulsoup.BeautifulSoup.Tag.recursiveChildGenerator"></a>
  607. <a name="recursiveChildGenerator"></a>
  608. <div class="functionHeader">
  609. def recursiveChildGenerator(self):
  610. </div>
  611. <div class="functionBody">
  612. <div class="undocumented">Undocumented</div>
  613. </div>
  614. </div>
  615. <address>
  616. <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.
  617. </address>
  618. </body>
  619. </html>