I have a simple scrapper

import requests from bs4 import BeautifulSoup page = requests.get('https://dom.ria.com/ru/%D0%9A%D0%B0%D1%82%D0%B0%D0%BB%D0%BE%D0%B3/%D0%9F%D1%80%D0%BE%D0%B4%D0%B0%D0%B6%D0%B0/%D0%9A%D0%B2%D0%B0%D1%80%D1%82%D0%B8%D1%80%D1%8B/%D0%9A%D0%B2%D0%B0%D1%80%D1%82%D0%B8%D1%80%D0%B0/%D0%9E%D0%B1%D0%BB%D0%B0%D1%81%D1%82%D1%8C/%D0%9A%D0%B8%D0%B5%D0%B2%D1%81%D0%BA%D0%B0%D1%8F/%D0%93%D0%BE%D1%80%D0%BE%D0%B4/%D0%9A%D0%B8%D0%B5%D0%B2/') soup = BeautifulSoup(page.text, 'html.parser') # Remove bottom links artist_name_list = soup.find_all(class_='wrap_desc') arr = [] for i in range (len(artist_name_list)): name = artist_name_list[i].find(class_='blue') main = (name.get_text()) arr.append(main) print(arr) with open('file.txt', 'a') as f: f.write(str(arr)) f.close() 

He should read from the site and then start in a text document. He reads but what I get, in a strange format, print (arr) prints something like this (this is not all that it prints) ‑н.\xa0Соломенский Лебедева-Кумача улица . The second problem is that it gives an error.

 return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 22-24: character maps to <undefined>. 

I tried to translate arr.encode('utf-8') into UTF-8 but it says that it is impossible. I tried

 main = (name.get_text().encode('utf-8')) 

Coming out

 xbb. \xd0\x9d\xd0\xb8\xd0\xba\xd0\xbe\xd0\xbb\xd1\x8c\xd1\x81\xd0\xba\xd0\xbe-\xd0\xa1\xd0\xbb\xd0\xbe\xd0\xb1\xd0\xbe\xd0\xb4\xd1\x81\xd0\xba\xd0\xb0\xd1\x8f 

0