def __init__(self, driver, lock, first_url, db_int=1): self.driver = driver self.driver.implicitly_wait(10) self.driver.set_page_load_timeout(30) self.r = RedisRecord() self.lock = lock self.queue = deque([]) self.queue.append(first_url) self.dbs = [1, 2]
def __init__(self, db_value, lock): self.r = RedisRecord() self.connection = MongoClient(host='localhost', port=27017, db=db_value) self.db = self.connection[db_value] threading.Thread.__init__(self) self.lock = lock