I'm using BeautifulSoup and trying to read a site which is written in hebrew and encoded in windows-1255 according to this line:
<meta http-EQUIV="Content-Type" Content="text/html; charset=windows-1255">
when I'm trying to encode it, I get the following error:
> UnicodeEncodeError: 'charmap' codec can't encode characters in position 6949-6950: character maps to <undefined>
The code:
from bs4 import BeautifulSoup
import requests
r = requests.get('http://www.plonter.co.il')
soup = BeautifulSoup(r.text)
print soup.prettify().encode('windows-1255')