`self.urlOpen=urllib.request.urlopen("http://facebook.com")
self.content=self.urlOpen.read()
soup=BeautifulSoup(self.content,"html5lib")
self.links=soup.find_all("a")`
위치에 문자를 인코딩 할 수'문자표'코덱 ....BeautifulSoup encoding.bytes에는 find_all이라는 속성이 없습니까?
그래서 내가 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")
'바이트'개체가이
수프 변수를 인코딩 할 때 find_all이라는 속성이 없음
시도했습니다. 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")
디버깅 도움말을 요청할 때 전체 추적을 포함하십시오. –
또한'soup.encode ('utf-8')'(바이트 문자열 생성) (https://www.crummy.com/software/BeautifulSoup/bs4/doc/#non-pretty-printing) 아웃 물론, find_all() 메소드가 없다. –
당신은 아마 [이] (http://stackoverflow.com/questions/14284269/why-doesnt-python-recognize-my-utf-8-encoded-source-file)로 고통 받고 있습니다 : 당신의 터미널은 처리 할 수 없습니다 출력 대신에 beautifulsoup 등의 문제가 있습니다. –