Skip to content

Commit e5cda57

Browse files
committed
DAY 5 OF 14 PYTHON CHALLENGE
1 parent d76f26e commit e5cda57

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import os
2+
import requests
3+
from bs4 import BeautifulSoup
4+
5+
os.system("clear")
6+
url = "https://www.iban.com/currency-codes"
7+
8+
countries = []
9+
10+
request = requests.get(url)
11+
soup = BeautifulSoup(request.text, "html.parser")
12+
13+
# table class = table table-bordered downloads tablesorter
14+
table = soup.find("table")
15+
16+
# th(thead), tbody >> tr(table row) >> td(table data)
17+
# td[0] = th - Country, Currency, Code, Number
18+
# td[1~] = tb - Value
19+
# td[0:3] = print(td[0, 1, 2])
20+
rows = table.find_all("tr")[1:-2]
21+
22+
print(rows)

0 commit comments

Comments
 (0)