'ValueError: No tables found by using pd.read_html from the Book: Python for Data Analysis(Wes McKinney)

I am learning from the Book: Python for Data Analysis by Wes McKinney, 2nd Edition.

On the page 180 I'm trying to run the code:

tables = pd.read_html('examples/fdic_failed_bank_list.html')

Because I'm using Jupyter Notebook(on a Windows pc) in previous examples I had to use "Backslash" instead.

The problem is the message I'm getting by running this code:

tables = pd.read_html('examples\fdic_failed_bank_list.html')
ValueError: No tables found.

I also tried to explicitly import bs4, html5lib, lxml, json, requests.

I also tried the following code:

url2='http://localhost:8888/view/Python%20for%20Data%20Analysis/examples/fdic_failed_bank_list.html'

r = requests.get(url2)

soup = BeautifulSoup(r.content, 'lxml')

table = str(soup.select("table"))

tables = pd.read_html(table)

The suggestion with selenium was too complicated for me.

How can I solve this problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source