# variation of https://python-forum.io/thread-21314.html table = soup.find_all('table')[2] # we receive a list of tables table_body = table.find('tbody') data = [] rows = table_body.find_all('tr') for row in rows: cols = row.find_all(['td', 'th']) # consider rows AND headers cols = [ele for ele in cols] # get html tags, not .text data.append([ele for ele in cols if ele]) # directly via pandas import pandas as pd dfs = pd.read_html(content[1]['body']) #list of dfs[0].columns = ['key', 'value'] # set column names dfs[0]#[dfs[0].key == 'Status'].iloc[0]['value'] # read cell value
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter