Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- url = 'https://minfin.com.ua/currency/nbu/'
- money = []
- source = requests.get(url)
- main_text = source.text
- soup = BeautifulSoup(main_text)
- table = soup.find('table', {'class' : 'table-auto'})
- tr = table.findAll('td', {'class' : 'responsive-hide'})
- money.extend(tr)
- for f in money[:3]:
- f = f.text
- vibor = input("Выберите валюту: doll, euro, rub ")
- if vibor == "doll":
- print("Курс доллара " + f[:7])
- break
- elif vibor == "euro":
- print(f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement