`self.urlOpen=urllib.request.urlopen("http://facebook.com")
self.content=self.urlOpen.read()
soup=BeautifulSoup(self.content,"html5lib")
self.links=soup.find_all("a")`
'charmap' codec can't encode characters in position....
so when i try to encode the soup variable
self.urlOpen=urllib.request.urlopen("http://facebook.com")
self.content=self.urlOpen.read()
soup=BeautifulSoup(self.content,"html5lib")
soup=soup.encode("utf-8")
self.links=soup.find_all("a")
'bytes' object has no attribute called find_all
I have tried
self.urlOpen=urllib.request.urlopen("http://facebook.com")
self.content=self.urlOpen.read()
soup=BeautifulSoup(self.content.decode("utf-8","ignore"),"html5lib")
self.links=soup.find_all("a")
but same error occurs
Then how should I encode it?