def __init__(self, host, port, dbName, collectionName, indexName=None): LogHelper.log("created") self.host = host self.port = port self.client = MongoClient(host, port) self.db = self.client[dbName] self.collection = self.db[collectionName] self.indexName = indexName self.startId = None if self.indexName != None: self.collection.create_index(self.indexName)
def __init__(self, host, port, dbName, user, password): LogHelper.log("created") self._host = host self._port = port self._user = user self._password = password self._dbName = dbName self._connection = pymysql.connect( host=self._host, user=self._user, password=self._password, db=self._dbName, charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor)
def __init__(self): LogHelper.log("created") self.url = 'https://translate.google.cn/?hl=en#zh-CN/en/' self.driver = webdriver.Chrome() self.driver.get(self.url) time.sleep(1)
def __init__(self): LogHelper.log("created")
def __init__(self, host, userName, userPassword): LogHelper.log("created") self._host = host self._userName = userName self._userPassword = userPassword self._basicAuth = HTTPBasicAuth(self._userName, self._userPassword)