#-*- coding:utf-8 -*-  
import urllib
import threading

def 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'又完事儿了。。'

多线程:获取网页状态码

相关文章:

  • 2021-11-13
  • 2021-12-18
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-09-18
相关资源
相似解决方案