@@ -489,7 +489,7 @@ def _expand_colspan_rowspan(self, rows, header=False):
489
489
"""
490
490
all_texts = [] # list of rows, each a list of str
491
491
remainder : list [
492
- tuple [int , str | tuple , int ]
492
+ tuple [int , str | tuple [ str ] | tuple [ str , str ] , int ]
493
493
] = [] # list of (index, text, nrows)
494
494
495
495
for tr in rows :
@@ -509,12 +509,14 @@ def _expand_colspan_rowspan(self, rows, header=False):
509
509
index += 1
510
510
511
511
# Append the text from this <td>, colspan times
512
- text = _remove_whitespace (self ._text_getter (td ))
512
+ td_text = _remove_whitespace (self ._text_getter (td ))
513
513
if not header and self .extract_hrefs :
514
514
# All cells will be tuples except for the headers for
515
515
# consistency in selection (e.g. using .str indexing)
516
516
href = self ._href_getter (td )
517
- text = (text , href ) if href else (text ,)
517
+ text = (td_text , href ) if href else (td_text ,)
518
+ else :
519
+ text = td_text
518
520
rowspan = int (self ._attr_getter (td , "rowspan" ) or 1 )
519
521
colspan = int (self ._attr_getter (td , "colspan" ) or 1 )
520
522
0 commit comments