21 lines
638 B
Python
21 lines
638 B
Python
from typing import Any, Generic, TypeVar
|
|
|
|
from bs4 import Tag
|
|
|
|
from omniread.core.content import Content, ContentType
|
|
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) -> str | None: ...
|
|
@staticmethod
|
|
def parse_table(table: Tag) -> list[list[str]]: ...
|
|
def parse_meta(self) -> dict[str, Any]: ...
|