首页 > 代码库 > 多线程:获取网页状态码

多线程:获取网页状态码

#-*- coding:utf-8 -*-  import urllibimport threadingdef func(url):    status = urllib.urlopen(url).code    print status    urlinfo = [http://www.sohu.com,http://www.163.com,http://www.sina.com]for url in urlinfo:    th = threading.Thread(target = func,args = [url])    th.start()    th.join()    print u又完事儿了。。

多线程:获取网页状态码