Skip to content

BUG: read_html - file path cannot be pathlib.Path type #37705

@simon-spier0

Description

@simon-spier0
import pandas as pd
from pathlib import Path


file_path_string = r'C:\Users\Desktop\my_file.html'
file_path = Path(file_path_string)
df1 = pd.read_html(file_path_string)[0]  # works fine
df2 = pd.read_html(file_path)[0]  # raises TypeError: cannot parse 'from WindowsPath'

Why do read_excel(), read_csv(), to_excel(), to_csv(), ... support pathlib.Path while read_html() doesn't?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions