【发布时间】:2017-02-18 03:15:38
【问题描述】:
我正在尝试使用 BeautifulSoup 从 HTML 表中提取数据并将其转换为 n x 7 数据框,其中包含以下列:日期、交易、清单编号、发货日期、付款类型、金额和预付余额。
到目前为止我的代码片段:
def find_account_status(htmls):
soup = BeautifulSoup(htmls)
table = soup.find('table', border="0", cellpadding="2")
table2 = table.find_all("td", {"class": "bodytext"}, text=True)
print(table2.text.split())
【问题讨论】:
标签: python web-scraping beautifulsoup html-table