Im getting error:
File "C:\Python34\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u0106' in position 73: character maps to
This is my code:
import requests from bs4 import BeautifulSoup url = 'http://www.privredni-imenik.com/firma/68225-a_expo' r = requests.get(url) soup = BeautifulSoup(r.content, "html.parser") g_data = soup.find_all("div", {"class":"podaci"}) print(g_data) How can i encode data in utf-8. i have tried solutions from other topics, but none of them work for me.
# -*- coding: utf-8 -*-at the begging of your file?g_data.decode('utf_8')