def get_verifycode():
global cookie
cookie = cookielib.LWPCookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie), urllib2.HTTPHandler)
urllib2.install_opener(opener)
img = urllib2.urlopen('http://xk.urp.seu.edu.cn/jw_css/getCheckCode', timeout=8)
f = open('verifycode.jpg', 'wb')
f.write(img.read())
f.close()
return 0
评论列表
文章目录