HTML to Dataframe

Question:

I am trying to read an local HTML file with pandas so I can convert it to a Dataframe but I am getting this error:

ValueError: invalid literal for int() with base 10: ‘0.5’

df = pd.read_html(loca_url)

I am sending the file attached so you can download it and try.
Thanks for your help in advanced.

Html file

Asked By: Dini

||

Answers:

There is a problem with html file in line 32:

<th colspan="0.5" >Material: </th>

According to html documentation colspan attribute should be an integer.

You need to fix the above mentioned line to:

<th colspan="1" >Material: </th>

or another desired integer. Changing it to 1 solved it for me.

Answered By: MarcinKamil
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.