Skip to content
Advertisement

A problem with web scraping using python ,BeautifulSoup and pandas ‘read_html’

Thank you for the helpers !

I am scraping a table of data about covid19 and push it into a pandas data frame , it was working until this morning .

That the code :

JavaScript

This morning I starting to get the next error :

JavaScript

Can you please help me figure it out ?

Advertisement

Answer

Try changing the last line to: df = pd.read_html(str(table), displayed_only=False)[0] The table header at the url has changed its style attribute to style=”width:100%;margin-top: 0px !important;display:none;”. Previously it did not have the ‘display’ tag set.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement