@@ -323,16 +323,20 @@ def get_footer_value_by_header(self, header_name: str) -> str:
323323 raise ValueError (f"Column '{ header_name } ' not found" )
324324
325325 # Try to locate footer cell in tbody (last row), or fallback to tfoot
326- footer_cell_tbody = self .page .locator (f"{ self .table_id } tbody tr:last-child td:nth-child({ column_index } )" )
327- footer_cell_tfoot = self .page .locator (f"{ self .table_id } tfoot tr td:nth-child({ column_index } )" )
326+ footer_cell_tbody = self .page .locator (
327+ f"{ self .table_id } tbody tr:last-child td:nth-child({ column_index } )"
328+ )
329+ footer_cell_tfoot = self .page .locator (
330+ f"{ self .table_id } tfoot tr td:nth-child({ column_index } )"
331+ )
328332
329333 if footer_cell_tbody .count () and footer_cell_tbody .first .is_visible ():
330334 return footer_cell_tbody .first .inner_text ().strip ()
331335 elif footer_cell_tfoot .count () and footer_cell_tfoot .first .is_visible ():
332336 return footer_cell_tfoot .first .inner_text ().strip ()
333337 else :
334338 raise ValueError (f"No footer cell found under column '{ header_name } '" )
335-
339+
336340 def get_row_where (self , criteria : dict [str , str ]) -> Locator | None :
337341 """
338342 Finds and returns the first table row matching the given header-value criteria.
@@ -346,6 +350,9 @@ def get_row_where(self, criteria: dict[str, str]) -> Locator | None:
346350 row_count = self .get_row_count ()
347351 for i in range (row_count ):
348352 row_data = self .get_row_data_with_headers (i )
349- if all (row_data .get (key , "" ).strip () == value for key , value in criteria .items ()):
353+ if all (
354+ row_data .get (key , "" ).strip () == value
355+ for key , value in criteria .items ()
356+ ):
350357 return self .pick_row (i )
351358 return None
0 commit comments