Skip to content

Commit

Permalink
Backport PR #58100 on branch 2.2.x (MNT: fix compatibility with beaut…
Browse files Browse the repository at this point in the history
…ifulsoup4 4.13.0b2) (#58137)

Backport PR #58100: MNT: fix compatibility with beautifulsoup4 4.13.0b2

Co-authored-by: Clément Robert <cr52@protonmail.com>
  • Loading branch information
meeseeksmachine and neutrinoceros committed Apr 3, 2024
1 parent 0f83d50 commit b56842d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pandas/io/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,14 +591,8 @@ class _BeautifulSoupHtml5LibFrameParser(_HtmlFrameParser):
:class:`pandas.io.html._HtmlFrameParser`.
"""

def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
from bs4 import SoupStrainer

self._strainer = SoupStrainer("table")

def _parse_tables(self, document, match, attrs):
element_name = self._strainer.name
element_name = "table"
tables = document.find_all(element_name, attrs=attrs)
if not tables:
raise ValueError("No tables found")
Expand Down

0 comments on commit b56842d

Please sign in to comment.