
| Current Path : /proc/thread-self/root/usr/local/lib/python3.8/dist-packages/silverware/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //proc/thread-self/root/usr/local/lib/python3.8/dist-packages/silverware/separate_row_header.py |
from .clone_beautiful_soup_tag import clone_beautiful_soup_tag
def separate_row_header(row):
row = clone_beautiful_soup_tag(row)
header = row.find('th')
if header:
header_clone = clone_beautiful_soup_tag(header)
header.decompose()
return header_clone, row
else:
return header, row
def separate_row_headers(table):
"""
:param table:
:rtype: list
"""
return [separate_row_header(row) for row in table.find_all('tr')]