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