IM试图让代理出一个网页的AttributeError的: '模块' 对象有 '的urlopen' python2.7
import urllib
import re
myfile = open("C:\\Users\Teli\Desktop\pro.txt", "w")
page = urllib.urlopen("http://www.samair.ru/proxy/ip-address-01.htm").read()
a = re.findall('\d+\.\d+\.\d+\.\d+', page)
myfile.write(str(a))
myfile.close()
它为什么说不属性:
page = urllib.urlopen("http://www.samair.ru/proxy/ip-address-01.htm").read()
AttributeError: 'module' object has no attribute 'urlopen'
你确定你使用Python 2? – Blender 2013-04-28 21:17:47
即时通讯使用python2.7 – 2013-04-28 21:23:00
什么'print(__ import __('sys')。version)'output? – Blender 2013-04-28 21:24:04