1. def single_thread():
    2. print('single_thead begin')
    3. for url in blog_spider.urls:
    4. blog_spider.craw(url)
    5. print("single_thread end")
    6. def multi_thread():
    7. print('multi_thread begin')
    8. threads = []
    9. for url in blog_spider.urls:
    10. threads.append(thread.Thread(blog_spider,args=(url,)))
    11. for thread in threads:
    12. thread.start()
    13. for thrad in threads:
    14. thread.join()
    15. print("multi_thread end")