Skip to content

Commit 619fced

Browse files
committed
Fix issue 59147
1 parent 7ca6cd0 commit 619fced

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pandas/io/html.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,9 @@ def _expand_colspan_rowspan(
507507

508508
# Append the text from this <td>, colspan times
509509
text = _remove_whitespace(self._text_getter(td))
510+
if len(text) == 0:
511+
text = self._text_getter(td)
512+
510513
if self.extract_links in ("all", section):
511514
href = self._href_getter(td)
512515
text = (text, href)
@@ -1027,6 +1030,7 @@ def read_html(
10271030
extract_links: Literal[None, "header", "footer", "body", "all"] = None,
10281031
dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default,
10291032
storage_options: StorageOptions = None,
1033+
skip_blank_lines: bool = True,
10301034
) -> list[DataFrame]:
10311035
r"""
10321036
Read HTML tables into a ``list`` of ``DataFrame`` objects.
@@ -1145,6 +1149,9 @@ def read_html(
11451149
{storage_options}
11461150
11471151
.. versionadded:: 2.1.0
1152+
1153+
skip_blank_lines: bool, default True
1154+
Whether lines containing only spaces should be skipped or not.
11481155
11491156
Returns
11501157
-------
@@ -1201,9 +1208,9 @@ def read_html(
12011208

12021209
validate_header_arg(header)
12031210
check_dtype_backend(dtype_backend)
1204-
1211+
print("Value passed ", io.getvalue())
12051212
io = stringify_path(io)
1206-
1213+
print("Inside html.py ", io.getvalue())
12071214
return _parse(
12081215
flavor=flavor,
12091216
io=io,
@@ -1223,4 +1230,5 @@ def read_html(
12231230
extract_links=extract_links,
12241231
dtype_backend=dtype_backend,
12251232
storage_options=storage_options,
1233+
skip_blank_lines=skip_blank_lines
12261234
)

0 commit comments

Comments
 (0)