(htmlSource, baseURI, encoding)
| 2406 | self.xfn.append({"relationships": xfn_rels, "href": elm.get('href', ''), "name": elm.string}) |
| 2407 | |
| 2408 | def _parseMicroformats(htmlSource, baseURI, encoding): |
| 2409 | if not BeautifulSoup: return |
| 2410 | if _debug: sys.stderr.write('entering _parseMicroformats\n') |
| 2411 | try: |
| 2412 | p = _MicroformatsParser(htmlSource, baseURI, encoding) |
| 2413 | except UnicodeEncodeError: |
| 2414 | # sgmllib throws this exception when performing lookups of tags |
| 2415 | # with non-ASCII characters in them. |
| 2416 | return |
| 2417 | p.vcard = p.findVCards(p.document) |
| 2418 | p.findTags() |
| 2419 | p.findEnclosures() |
| 2420 | p.findXFN() |
| 2421 | return {"tags": p.tags, "enclosures": p.enclosures, "xfn": p.xfn, "vcard": p.vcard} |
| 2422 | |
| 2423 | class _RelativeURIResolver(_BaseHTMLProcessor): |
| 2424 | relative_uris = [('a', 'href'), |
no test coverage detected