def work(): while True: url = thread_queue.get() Spider.crawled_page(threading.current_thread().name, url) thread_queue.task_done()