Reviewed-on: #1 Co-authored-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com> Co-committed-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com>
19 lines
676 B
Python
19 lines
676 B
Python
from typing import Any, Generic, TypeVar, Optional, list, dict
|
|
from bs4 import BeautifulSoup, Tag
|
|
from omniread.core.content import ContentType, Content
|
|
from omniread.core.parser import BaseParser
|
|
|
|
T = TypeVar("T")
|
|
|
|
class HTMLParser(BaseParser[T], Generic[T]):
|
|
supported_types: set[ContentType]
|
|
def __init__(self, content: Content, features: str = ...) -> None: ...
|
|
def parse(self) -> T: ...
|
|
@staticmethod
|
|
def parse_div(div: Tag, *, separator: str = ...) -> str: ...
|
|
@staticmethod
|
|
def parse_link(a: Tag) -> Optional[str]: ...
|
|
@staticmethod
|
|
def parse_table(table: Tag) -> list[list[str]]: ...
|
|
def parse_meta(self) -> dict[str, Any]: ...
|