eclipse import re 报错

来源:互联网 发布:成都软件开发工作室 编辑:程序博客网 时间:2024/06/05 18:10

今天想写一个正则表达式的测试程序

#encoding=utf-8'''Created on 2014��8��12��@author: Administrator'''import urllibimport rewenku = urllib.urlopen(r'********************************')req = wenku.read().decode('utf-8')wenku.close()result = re.findall(r'<li class="l2">(.*)</li>',req)print req
<div style="color: rgb(70, 70, 70); font-family: 'Microsoft YaHei', 'Helvetica Neue', SimSun; font-size: 14px; line-height: 21px; background-color: rgb(188, 211, 229);">谁知道在CMD里运行好好的,eclipse却一直报错</div><div style="color: rgb(70, 70, 70); font-family: 'Microsoft YaHei', 'Helvetica Neue', SimSun; font-size: 14px; line-height: 21px; background-color: rgb(188, 211, 229);"></div><div style="color: rgb(70, 70, 70); font-family: 'Microsoft YaHei', 'Helvetica Neue', SimSun; font-size: 14px; line-height: 21px; background-color: rgb(188, 211, 229);">最后发现是,文件名字取得不好,取了re.py,估计跟python自带的文件冲突了。。。我真是智商拙计啊。。以后取文件名不能取这种敏感的。。。</div>



0 0