Skip to content

Commit

Permalink
Backport PR pandas-dev#58100: MNT: fix compatibility with beautifulso…
Browse files Browse the repository at this point in the history
…up4 4.13.0b2
  • Loading branch information
neutrinoceros authored and meeseeksmachine committed Apr 3, 2024
1 parent e9b81ee commit cfe7f7b
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 cfe7f7b

Please sign in to comment.