import csv
import requests
from bs4 import BeautifulSoup
url = 'https://www.alta.ru/currency/'
r = requests.get(url)
soup = BeautifulSoup(r.text, 'lxml')
name = soup.find_all('td',class_ = 't-left')
price = soup.find_all(class_ = 't-right')
with open('data.csv', 'w', newline = '') as file:
writer = csv.writer(file)
for names in name:
writer.writerow([names.text])
for prices in price:
writer.writerow([prices.text])
主页
/
user-507832