A MediaWiki article returned from MediaWiki.search(). MediaWikiArticle.string contains the HTML content.
(self, title=u"", source=u"", links=[], categories=[], languages={}, disambiguation=False, **kwargs)
| 1756 | class MediaWikiArticle(object): |
| 1757 | |
| 1758 | def __init__(self, title=u"", source=u"", links=[], categories=[], languages={}, disambiguation=False, **kwargs): |
| 1759 | """ A MediaWiki article returned from MediaWiki.search(). |
| 1760 | MediaWikiArticle.string contains the HTML content. |
| 1761 | """ |
| 1762 | self.title = title # Article title. |
| 1763 | self.source = source # Article HTML content. |
| 1764 | self.sections = [] # Article sections. |
| 1765 | self.links = links # List of titles of linked articles. |
| 1766 | self.categories = categories # List of categories. As links, prepend "Category:". |
| 1767 | self.external = [] # List of external links. |
| 1768 | self.media = [] # List of linked media (images, sounds, ...) |
| 1769 | self.disambiguation = disambiguation # True when the article is a disambiguation page. |
| 1770 | self.languages = languages # Dictionary of (language, article)-items, e.g. Cat => ("nl", "Kat") |
| 1771 | self.language = kwargs.get("language", "en") |
| 1772 | self.parser = kwargs.get("parser", MediaWiki()) |
| 1773 | for k, v in kwargs.items(): |
| 1774 | setattr(self, k, v) |
| 1775 | |
| 1776 | def _plaintext(self, string, **kwargs): |
| 1777 | """ Strips HTML tags, whitespace and wiki markup from the HTML source, including: |