导入错误:没有指定名为“xxxx”的模块

2024-09-27 23:47:03 发布

您现在位置:Python中文网/ 问答频道 /正文

基本上,我要做的是用python编写一个程序,它获取一个URL,复制源代码,并将所有注释提取出来并呈现给用户。在

import urllib2
import html2text
import PullsCommentsOut.pullscommentsout


url = raw_input('Please input URL with the text you want to analyze: ')
page = urllib2.urlopen(url)
html_content = page.read().decode('utf8')
rendered_content = html2text.html2text(html_content).encode('ascii', 
'ignore')

f = open('file_text.txt', 'wb')
f.write(rendered_content)
f.close()

result = PullsCommentsOut.pullscommentsout(html_content)
print result

还有我的第二个文件“PullsCommentsOut”

^{pr2}$

我一辈子都不明白为什么Python不认为我没有导入正确的模块?这没道理。在

我需要添加更多的文本,以便它允许我发帖,那么,你们都做得怎么样?我想我做得很好。没有抱怨。在


Tags: textimport程序urlinputhtmlpageresult

热门问题