import requests
import bs4
url = '
https://quotes.toscrape.com/'
response = requests.get(url)
soup = bs4.BeautifulSoup(response.text,'lxml')
result = soup.find_all('span',class_='text')
result_author = soup.find_all('small',class_='author')
author = []
text_author = []
result_reg = []
for res in result:
text_author.append(res.text)
for res1 in result_author:
author.append(res1.text)
for i in zip(text_author,author):
result_reg.append(i)
print(result_reg)
with open('info.txt','w') as f:
for i,j in result_reg:
text_correct = f'Цитата {i}\n Автор {j}\n'
f.write(text_correct)