|
57 | 57 | BaseBuffer, |
58 | 58 | DtypeBackend, |
59 | 59 | FilePath, |
| 60 | + HTMLFlavors, |
60 | 61 | ReadBuffer, |
61 | 62 | StorageOptions, |
62 | 63 | ) |
@@ -889,13 +890,13 @@ def _data_to_frame(**kwargs): |
889 | 890 | } |
890 | 891 |
|
891 | 892 |
|
892 | | -def _parser_dispatch(flavor: str | None) -> type[_HtmlFrameParser]: |
| 893 | +def _parser_dispatch(flavor: HTMLFlavors | None) -> type[_HtmlFrameParser]: |
893 | 894 | """ |
894 | 895 | Choose the parser based on the input flavor. |
895 | 896 |
|
896 | 897 | Parameters |
897 | 898 | ---------- |
898 | | - flavor : str |
| 899 | + flavor : {{"lxml", "html5lib", "bs4"}} or None |
899 | 900 | The type of parser to use. This must be a valid backend. |
900 | 901 |
|
901 | 902 | Returns |
@@ -1033,7 +1034,7 @@ def read_html( |
1033 | 1034 | io: FilePath | ReadBuffer[str], |
1034 | 1035 | *, |
1035 | 1036 | match: str | Pattern = ".+", |
1036 | | - flavor: str | Sequence[str] | None = None, |
| 1037 | + flavor: HTMLFlavors | Sequence[HTMLFlavors] | None = None, |
1037 | 1038 | header: int | Sequence[int] | None = None, |
1038 | 1039 | index_col: int | Sequence[int] | None = None, |
1039 | 1040 | skiprows: int | Sequence[int] | slice | None = None, |
@@ -1074,7 +1075,7 @@ def read_html( |
1074 | 1075 | This value is converted to a regular expression so that there is |
1075 | 1076 | consistent behavior between Beautiful Soup and lxml. |
1076 | 1077 |
|
1077 | | - flavor : str or list-like, optional |
| 1078 | + flavor : {{"lxml", "html5lib", "bs4"}} or list-like, optional |
1078 | 1079 | The parsing engine (or list of parsing engines) to use. 'bs4' and |
1079 | 1080 | 'html5lib' are synonymous with each other, they are both there for |
1080 | 1081 | backwards compatibility. The default of ``None`` tries to use ``lxml`` |
|
0 commit comments