亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: 使用nltk報(bào)錯(cuò) [打印本頁(yè)]

作者: maple412    時(shí)間: 2015-10-19 21:45
標(biāo)題: 使用nltk報(bào)錯(cuò)
想通過(guò)nltk中的clean_html功能來(lái)清除html內(nèi)容
import nltk,re,pprint
import urllib2
html='‘    /論壇發(fā)不了html鏈接/
h=urllib2.urlopen(html)
c=h.read()
raw=nltk.clean_html(c)
但是報(bào)如下的錯(cuò)誤
Traceback (most recent call last):
  File "E:\python_project\test1.py", line 7, in <module>
    raw=nltk.clean_html(c)
  File "E:\python2.7\lib\site-packages\nltk\util.py", line 346, in clean_html
    raise NotImplementedError ("To remove HTML markup, use BeautifulSoup's get_text() function")
NotImplementedError: To remove HTML markup, use BeautifulSoup's get_text() function

作者: maple412    時(shí)間: 2015-10-30 21:35
這個(gè)有人知道嗎?
作者: substr函數(shù)    時(shí)間: 2015-10-30 22:43
raise NotImplementedError
究竟什么是 NotImplementedError? 未實(shí)現(xiàn)錯(cuò)誤?

根據(jù) nltk\util.py:
不幸的是 clean_html 當(dāng)然是未實(shí)現(xiàn)
  1. def clean_html(html):
  2.     raise NotImplementedError ("To remove HTML markup, use BeautifulSoup's get_text() function")
復(fù)制代碼
解決方案 建議使用
To remove HTML markup, use BeautifulSoup's get_text() function




歡迎光臨 Chinaunix (http://www.72891.cn/) Powered by Discuz! X3.2