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