<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def launchQueryForMode(self, query=None, mode=None):
 """ Method that launches an i3Browser to collect data. Args: ----- query: The query to be performed mode: The mode to be used to build the query. Return: ------- A string containing the recovered data or None. """

        # Creating the query URL for that mode
        qURL = self.createURL(word=query, mode=mode)
        i3Browser = browser.Browser()

        try:
            # Check if it needs creds
            if self.needsCredentials[mode]:
                self._getAuthenticated(i3Browser, qURL)
                data = i3Browser.recoverURL(qURL)
            else:
                # Accessing the resources
                data = i3Browser.recoverURL(qURL)
            return data
        except KeyError:
            print(general.error("[*] '{}' is not a valid mode for this wrapper ({}).".format(mode, self.__class__.__name__)))

        return None