Python - Flask - gazpacho - Working with HTML - Web Scraping - table, rows, columns, tr tag, td tag
Head First Python: A Learner’s Guide to the Fundamentals of Python Programming, A Brain-Friendly Guide、 Paul Barry(著)、 O’Reilly Mediaの Chapter 9.(Working with HTML: Web Scraping)、EXERCISE(441/682)の解答を求めてみる。
Jupyter(コード、入出力結果)
WorldRecords.ipynb
for i, table in enumerate(tables, start=1):
row = table.find('tr', mode='all')
print(f'{i:2}: {len(row):2}')
1: 21
2: 21
3: 3
4: 25
5: 26
6: 4
7: 26
8: 1
9: 7
10: 5
11: 8