scraped text in Russian encoding python
from bs4 import BeautifulSoup import requests source = requests.get('https://time.mk/') # don't convert to text just yet # print(source.encoding) # prints out ISO-8859-1 source.encoding = 'utf-8' # override encoding manually soup = BeautifulSoup(source.text, 'lxml') # this will now decode utf-8 correctly
Source: stackoverflow.com