How it works...

It is typical to call read_html multiple times before arriving at the table (or tables) that you desire. There are two primary parameters at your disposal to specify a table, match and attrs. The string provided to match is used to find an exact match for the actual text in the table. This is text that will show up on the web page itself. The attrs parameter, on the other hand, searches for HTML table attributes found directly after the start of the table tag, <table. To see more of the table attributes, visit this page from W3 Schools (http://bit.ly/2hzUzdD).

Once we find our table in step 8, we can still take advantage of some other parameters to simplify things. HTML tables don't typically translate directly to nice DataFrames. ...

Get Pandas Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.