Код представлен ниже:
import requests from bs4 import BeautifulSoup def f(m, url): source = requests.get(url) main_text = source.text soup = BeautifulSoup(main_text, 'html.parser') table = soup.findAll('td') table = str(table) n = '' for i in table: #отбирает с строки только числа if i.isdigit(): n += i else: if n.isdigit(): m.append(float(n)) n = '' if n != '': m.append(float(n)) m = [] url = 'URL_САЙТА' f(m, url) if len(m) < 100: dollar_buy = (m[0]) dollar_sale = (m[2]) euro_buy = (m[4]) euro_sale = (m[6]) tenge_buy = (m[9]) tenge_sale = (m[11])