def get_pac(self):
        """
        Search for, download, and parse PAC file if it hasn't already been done.
        This method is called upon the first use of :meth:`request`,
        but can also be called manually beforehand if desired.
        Subsequent calls to this method will only return the obtained PAC file, if any.

        :returns: The obtained PAC file, if any.
        :rtype: PACFile|None
        :raises MalformedPacError: If something that claims to be a PAC file was downloaded but could not be parsed.
        """
        if self._tried_get_pac:
            return self._proxy_resolver.pac if self._proxy_resolver else None

        if not self.pac_enabled:
            return

        pac = get_pac()
        self._tried_get_pac = True
        if pac:
            self._proxy_resolver = self._get_proxy_resolver(pac)
        return pac