class_docstr: Base class for parsers that parse HTML into DataFrames.
  
  Parameters
  ----------
  io : str or file-like
      This can be either a string of raw HTML, a valid URL using the HTTP,
      FTP, or FILE protocols or a file-like object.
  
  match : str or regex
      The text to match in the document.
  
  attrs : dict
      List of HTML <table> element attributes to match.
  
  encoding : str
      Encoding to be used by parser
  
  displayed_only : bool
      Whether or not items with "display:none" should be ignored
  
  extract_links : {None, "all", "header", "body", "footer"}
      Table elements in the specified section(s) with <a> tags will have their
      href extracted.
  
      .. versionadded:: 1.5.0
  
  Attributes
  ----------
  io : str or file-like
      raw HTML, URL, or file-like object
  
  match : regex
      The text to match in the raw HTML
  
  attrs : dict-like
      A dictionary of valid table attributes to use to search for table
      elements.
  
  encoding : str
      Encoding to be used by parser
  
  displayed_only : bool
      Whether or not items with "display:none" should be ignored
  
  extract_links : {None, "all", "header", "body", "footer"}
      Table elements in the specified section(s) with <a> tags will have their
      href extracted.
  
      .. versionadded:: 1.5.0
  
  Notes
  -----
  To subclass this class effectively you must override the following methods:
      * :func:`_build_doc`
      * :func:`_attr_getter`
      * :func:`_href_getter`
      * :func:`_text_getter`
      * :func:`_parse_td`
      * :func:`_parse_thead_tr`
      * :func:`_parse_tbody_tr`
      * :func:`_parse_tfoot_tr`
      * :func:`_parse_tables`
      * :func:`_equals_tag`
  See each method's respective documentation for details on their
  functionality.
class_docstr_tok: ["Base","class","for","parsers","that","parse","HTML","into","DataFrames",".","Parameters","--","--","--","--","--","io",":","str","or","file-like","This","can","be","either","a","string","of","raw","HTML",",","a","valid","URL","using","the","HTTP",",","FTP",",","or","FILE","protocols","or","a","file-like","object",".","match",":","str","or","regex","The","text","to","match","in","the","document",".","attrs",":","dict","List","of","HTML","<","table",">","element","attributes","to","match",".","encoding",":","str","Encoding","to","be","used","by","parser","displayed_only",":","bool","Whether","or","not","items","with","``","display",":","none","''","should","be","ignored","extract_links",":","{","None",",","``","all","''",",","``","header","''",",","``","body","''",",","``","footer","''","}","Table","elements","in","the","specified","section","(","s",")","with","<","a",">","tags","will","have","their","href","extracted",".","..","versionadded",":",":","1.5.0","Attributes","--","--","--","--","--","io",":","str","or","file-like","raw","HTML",",","URL",",","or","file-like","object","match",":","regex","The","text","to","match","in","the","raw","HTML","attrs",":","dict-like","A","dictionary","of","valid","table","attributes","to","use","to","search","for","table","elements",".","encoding",":","str","Encoding","to","be","used","by","parser","displayed_only",":","bool","Whether","or","not","items","with","``","display",":","none","''","should","be","ignored","extract_links",":","{","None",",","``","all","''",",","``","header","''",",","``","body","''",",","``","footer","''","}","Table","elements","in","the","specified","section","(","s",")","with","<","a",">","tags","will","have","their","href","extracted",".","..","versionadded",":",":","1.5.0","Notes","--","--","-","To","subclass","this","class","effectively","you","must","override","the","following","methods",":","*",":","func",":","`","_build_doc","`","*",":","func",":","`","_attr_getter","`","*",":","func",":","`","_href_getter","`","*",":","func",":","`","_text_getter","`","*",":","func",":","`","_parse_td","`","*",":","func",":","`","_parse_thead_tr","`","*",":","func",":","`","_parse_tbody_tr","`","*",":","func",":","`","_parse_tfoot_tr","`","*",":","func",":","`","_parse_tables","`","*",":","func",":","`","_equals_tag","`","See","each","method","'s","respective","documentation","for","details","on","their","functionality","."]
docstr: Given a table, return parsed header, body, and foot.
  
  Parameters
  ----------
  table_html : node-like
  
  Returns
  -------
  tuple of (header, body, footer), each a list of list-of-text rows.
  
  Notes
  -----
  Header and body are lists-of-lists. Top level list is a list of
  rows. Each row is a list of str text.
  
  Logic: Use <thead>, <tbody>, <tfoot> elements to identify
         header, body, and footer, otherwise:
         - Put all rows into body
         - Move rows from top of body to header only if
           all elements inside row are <th>
         - Move rows from bottom of body to footer only if
           all elements inside row are <th>
docstr_tok: ["Given","a","table",",","return","parsed","header",",","body",",","and","foot",".","Parameters","--","--","--","--","--","table_html",":","node-like","Returns","--","--","--","-","tuple","of","(","header",",","body",",","footer",")",",","each","a","list","of","list-of-text","rows",".","Notes","--","--","-","Header","and","body","are","lists-of-lists",".","Top","level","list","is","a","list","of","rows",".","Each","row","is","a","list","of","str","text",".","Logic",":","Use","<","thead",">",",","<","tbody",">",",","<","tfoot",">","elements","to","identify","header",",","body",",","and","footer",",","otherwise",":","-","Put","all","rows","into","body","-","Move","rows","from","top","of","body","to","header","only","if","all","elements","inside","row","are","<","th",">","-","Move","rows","from","bottom","of","body","to","footer","only","if","all","elements","inside","row","are","<","th",">"]
code: def _parse_thead_tbody_tfoot(self, table_html):
      """
      Given a table, return parsed header, body, and foot.
  
      Parameters
      ----------
      table_html : node-like
  
      Returns
      -------
      tuple of (header, body, footer), each a list of list-of-text rows.
  
      Notes
      -----
      Header and body are lists-of-lists. Top level list is a list of
      rows. Each row is a list of str text.
  
      Logic: Use <thead>, <tbody>, <tfoot> elements to identify
             header, body, and footer, otherwise:
             - Put all rows into body
             - Move rows from top of body to header only if
               all elements inside row are <th>
             - Move rows from bottom of body to footer only if
               all elements inside row are <th>
      """
      header_rows = self._parse_thead_tr(table_html)
      body_rows = self._parse_tbody_tr(table_html)
      footer_rows = self._parse_tfoot_tr(table_html)
  
      def row_is_all_th(row):
          return all(
              self._equals_tag(t, "th") for t in self._parse_td(row)
          )
  
      if not header_rows:
          # The table has no <thead>. Move the top all-<th> rows from
          # body_rows to header_rows. (This is a common case because many
          # tables in the wild have no <thead> or <tfoot>
          while body_rows and row_is_all_th(body_rows[0]):
              header_rows.append(body_rows.pop(0))
  
      header = self._expand_colspan_rowspan(
          header_rows, section="header"
      )
      body = self._expand_colspan_rowspan(body_rows, section="body")
      footer = self._expand_colspan_rowspan(
          footer_rows, section="footer"
      )
  
      return header, body, footer
  
imports: from __future__ import annotations
  from collections import abc
  import numbers
  import re
  from typing import TYPE_CHECKING, Iterable, Literal, Pattern, Sequence, cast
  from pandas._libs import lib
  from pandas._typing import BaseBuffer, DtypeBackend, FilePath, ReadBuffer
  from pandas.compat._optional import import_optional_dependency
  from pandas.errors import AbstractMethodError, EmptyDataError
  from pandas.util._validators import check_dtype_backend
  from pandas.core.dtypes.common import is_list_like
  from pandas import isna
  from pandas.core.indexes.base import Index
  from pandas.core.indexes.multi import MultiIndex
  from pandas.core.series import Series
  from pandas.io.common import file_exists, get_handle, is_url, stringify_path, urlopen, validate_header_arg
  from pandas.io.formats.printing import pprint_thing
  from pandas.io.parsers import TextParser
label_desc: Use image node_id 13 for calling the _HtmlFrameParser obj's underlying member method code with example usage: obj._parse_thead_tbody_tfoot(table_html) and returns: header,  body,  footer, all